Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switch unit tests to use vitest (#1445)
* create a globalSetup for vitest * rename tests files to .test.js * delete useless files and lint * skip problematic test on firefox * fix * skip test * [WIP] Switch unit tests to use vitest To extrapolate on #1444, this PR shows how it would look like to switch from relying on Jest to rely on vitest for our unit tests. The end goal being to simplify our codebase by relying on a single testing framework. --- I only done so for testing files in the `src/compat` directory in this demo. It can be tested right now by calling `npm run test:unit:vitest`. --- Sadly for now, we are still forced to rely on a JSDom-ed Node.js environment for unit tests and a browser environment for integration tests - meaning we have very different configs for both. This is because we want to mock imported files in unit tests - something that is not possible for now in browser environment through vitest (though vitest/5765 seems to have been merged very recently so maybe we could rely on the browser for both soon), yet we want to replicate as much as a real browser as possible in our integration tests (because we're also testing that media playback on the tested browsers goes as expected). * Add test:unit:watch * tests: Fix and work around remaining unit test issues * wip * Reorder checks in often-failing integration test * Try to '''fix''' memory tests --------- Co-authored-by: Florent <[email protected]>
- Loading branch information