Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use vitest for integration tests #1444

Merged
merged 45 commits into from
Jun 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
0fb3715
install vitest
Florent-Bouisset May 30, 2024
7819494
add chrome flags for autoplay policy
Florent-Bouisset Jan 17, 2024
da5e392
add vitest import
Florent-Bouisset May 30, 2024
f50a8a4
change timeout config to be compatible with vitest API
Florent-Bouisset May 30, 2024
885d73e
fixup installation
Florent-Bouisset May 30, 2024
4ef4dfa
upgrade package.json
Florent-Bouisset May 31, 2024
435f2fc
change xit to supported api for vitest
Florent-Bouisset May 31, 2024
42d7149
use timeout api for vitest
Florent-Bouisset May 31, 2024
925bcc6
WIP
Florent-Bouisset May 31, 2024
0024308
delete deprecated tslint and add rule for type export
Florent-Bouisset May 31, 2024
05d6bf6
apply eslint fix for import type
Florent-Bouisset May 31, 2024
a37f46d
add global variable to vitest config
Florent-Bouisset May 31, 2024
3c90c33
remove webdriver lib from tsconfig
Florent-Bouisset May 31, 2024
0c9f39e
update memory test to be compliant with vitest API
Florent-Bouisset May 31, 2024
f3c2cf3
update package script to run memory test wiht vitest
Florent-Bouisset May 31, 2024
aa43018
add missing import for vitest
Florent-Bouisset May 31, 2024
edb91f4
remove chai from project and replace it by vitest assertion lib
Florent-Bouisset May 31, 2024
bf14213
try to upgrade node version in CI to fix bug
Florent-Bouisset May 31, 2024
2947a36
remove chai types
Florent-Bouisset May 31, 2024
52a7184
bump package version
Florent-Bouisset May 31, 2024
cdb6fac
add a vitest config
Florent-Bouisset May 31, 2024
736eb45
create a globalSetup for vitest
Florent-Bouisset May 31, 2024
f08acb7
change to new timeout api
Florent-Bouisset May 31, 2024
daaf48e
change require to import for raw and arraybuffer file
Florent-Bouisset May 31, 2024
275c3f4
fix: enable browser mode
Florent-Bouisset May 31, 2024
fea21cc
rename tests files to .test.js
Florent-Bouisset May 31, 2024
40a770b
update package.json scripts
Florent-Bouisset May 31, 2024
7868446
lint
Florent-Bouisset May 31, 2024
c717fd9
update CI to use npm script
Florent-Bouisset May 31, 2024
af212d9
Remove now unneeded dependencies
peaBerberian Jun 11, 2024
bc793b4
Re-add @vitest/browser
peaBerberian Jun 11, 2024
f5539c9
Remove notion of mocha chai and sinon from CONTRIBUTING.md, replacing…
peaBerberian Jun 11, 2024
51acb31
Remove reliance on sinon for fake timers and stubs
peaBerberian Jun 11, 2024
bdc78a1
parametrize test config so it can run on firefox
Florent-Bouisset Jun 4, 2024
c947122
use cross-env for compatibility
Florent-Bouisset Jun 4, 2024
0013136
delete useless files and lint
Florent-Bouisset Jun 11, 2024
fd8ba14
increase timeout for a flaky test
Florent-Bouisset Jun 11, 2024
d7a319c
skip problematic test on firefox
Florent-Bouisset Jun 12, 2024
20de75f
fix
Florent-Bouisset Jun 12, 2024
abec5d3
skip test
Florent-Bouisset Jun 13, 2024
cf5b08d
delete file globalSetup
Florent-Bouisset Jun 13, 2024
23eb81d
PR feedback
Florent-Bouisset Jun 13, 2024
d40a343
specify the folder scenario for integration tests
Florent-Bouisset Jun 13, 2024
bb5bedc
rename files
Florent-Bouisset Jun 14, 2024
a08a03b
make port param optional
Florent-Bouisset Jun 14, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 2 additions & 29 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,7 @@ module.exports = {
project: "tsconfig.eslint.json",
sourceType: "module",
},
plugins: [
"eslint-plugin-import",
"eslint-plugin-jsdoc",
"ban",
"@typescript-eslint",
"@typescript-eslint/tslint",
],
plugins: ["eslint-plugin-import", "eslint-plugin-jsdoc", "ban", "@typescript-eslint"],
rules: {
"ban/ban": [
2,
Expand Down Expand Up @@ -80,6 +74,7 @@ module.exports = {
},
],
"@typescript-eslint/consistent-type-imports": "error",
"@typescript-eslint/consistent-type-exports": "error",
"@typescript-eslint/naming-convention": [
"error",
{
Expand Down Expand Up @@ -309,27 +304,5 @@ module.exports = {
"use-isnan": "error",
"valid-typeof": "error",
yoda: "error",
"@typescript-eslint/tslint/config": [
"error",
{
rules: {
encoding: true,
"import-spacing": true,
"prefer-while": true,
"return-undefined": true,
whitespace: [
true,
"check-branch",
"check-decl",
"check-operator",
"check-module",
"check-separator",
"check-type",
"check-typecast",
"check-preblock",
],
},
},
],
},
};
10 changes: 5 additions & 5 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:

strategy:
matrix:
node-version: [16.x]
node-version: [20.x]
peaBerberian marked this conversation as resolved.
Show resolved Hide resolved
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
Expand All @@ -57,7 +57,7 @@ jobs:

strategy:
matrix:
node-version: [16.x]
node-version: [20.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
Expand All @@ -75,7 +75,7 @@ jobs:

strategy:
matrix:
node-version: [16.x]
node-version: [20.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
Expand All @@ -93,14 +93,14 @@ jobs:
- run: npm run build
# Firefox seems to have issue with integration tests on GitHub actions only
# TODO to check
- run: node tests/integration/run.mjs --bchromehl
- run: npm run test:integration

memory_linux:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [16.x]
node-version: [20.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ New integration tests are not required when a new code is added. Just make sure
those tests pass before doing a pull request by running: `npm run test:integration`.

It you want to improve our integration tests, you are welcome to do so. Those are wrote in
`tests/integration` with the help of the Mocha, Chai and Sinon libraries.
`tests/integration` with the help of the `vitest` library.

We also use a homemade library and server to serve media contents to our tests. If you
want to know how it works, we invite you to rely on the already created tests and to read
Expand All @@ -240,7 +240,7 @@ the corresponding files.
Memory tests replicate simple scenarios and try to detect memory leaks.

You can also help us improving our memory tests. Those are written in `test/memory`. The
testing stack used is Mocha, Chai and Sinon.
testing library used is `vitest`.

## Documentation

Expand Down
Loading
Loading