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

Make unit tests run in a browser #1622

Open
wants to merge 7 commits into
base: misc/env-detector-refacto
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
77 changes: 67 additions & 10 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 11 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -188,14 +188,18 @@
"start": "node ./scripts/start_demo_web_server.mjs",
"start:wasm": "node ./scripts/start_demo_web_server.mjs --include-wasm",
"test:integration": "npm run test:integration:chrome && npm run test:integration:firefox",
"test:integration:chrome": "cross-env BROWSER_CONFIG=chrome vitest run tests/integration/scenarios",
"test:integration:chrome:watch": "cross-env BROWSER_CONFIG=chrome vitest watch tests/integration/scenarios",
"test:integration:firefox": "cross-env BROWSER_CONFIG=firefox vitest run tests/integration/scenarios",
"test:integration:firefox:watch": "cross-env BROWSER_CONFIG=firefox vitest watch tests/integration/scenarios",
"test:integration:chrome": "npm run --silent test:integration:notice && cross-env BROWSER_CONFIG=chrome vitest run tests/integration/scenarios",
"test:integration:chrome:watch": "npm run --silent test:integration:notice && cross-env BROWSER_CONFIG=chrome vitest watch tests/integration/scenarios",
"test:integration:firefox": "npm run --silent test:integration:notice && cross-env BROWSER_CONFIG=firefox vitest run tests/integration/scenarios",
"test:integration:firefox:watch": "npm run --silent test:integration:notice && cross-env BROWSER_CONFIG=firefox vitest watch tests/integration/scenarios",
"test:integration:notice": "echo \"~~~ ⚠️ NOTICE ⚠️\n~~~ Integration tests rely on the RxPlayer build.\n~~~ Make sure you called the \\`build\\` script succesfully first.\n\"",
"test:memory": "cross-env BROWSER_CONFIG=chrome vitest run tests/memory",
"test:memory:chrome:watch": "cross-env BROWSER_CONFIG=chrome vitest watch tests/memory",
"test:unit": "vitest --config vitest.config.unit.mjs",
"test:unit:watch": "cross-env WATCH=true vitest --config vitest.config.unit.mjs",
"test:unit": "npm run test:unit:chrome && npm run test:unit:firefox",
"test:unit:chrome": "cross-env BROWSER_CONFIG=chrome vitest src/",
"test:unit:firefox": "cross-env BROWSER_CONFIG=firefox vitest src/",
"test:unit:chrome:watch": "cross-env WATCH=true BROWSER_CONFIG=chrome vitest src/",
"test:unit:firefox:watch": "cross-env WATCH=true BROWSER_CONFIG=firefox vitest src/",
"update-version": "npm run version --git-tag-version=false",
"version": "./scripts/update-version",
"wasm-strip": "node scripts/wasm-strip.mjs dist/mpd-parser.wasm"
Expand Down Expand Up @@ -223,7 +227,6 @@
"esm": "3.2.25",
"github-buttons": "2.29.1",
"html-entities": "2.5.2",
"jsdom": "^25.0.1",
"prettier": "^3.4.2",
"react": "19.0.0",
"react-dom": "19.0.0",
Expand Down Expand Up @@ -261,7 +264,7 @@
"fmt:rust:check": "Check that Rust files are well-formatted"
},
"Run tests": {
"Integration tests (test the whole API, ensure the RxPlayer build is made BEFORE running them)": {
"Integration tests (test the whole API, call the `build` script BEFORE running them)": {
"test:integration": "Launch integration tests in multiple browser environments",
"test:integration:chrome": "Launch integration tests in a Chrome browser.",
"test:integration:chrome:watch": "Launch integration tests in Chrome each times the files update",
Expand Down
Loading
Loading