Commit aa68201
committed
[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-dev/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).1 parent 2537b4d commit aa68201
File tree
194 files changed
+14541
-21477
lines changed- src
- compat
- __tests__
- core
- adaptive
- __tests__
- utils/__tests__
- fetchers
- segment/__tests__
- errors/__tests__
- experimental
- features/__tests__
- tools/mediaCapabilitiesProber/__tests__
- probers
- features
- __tests__
- list/__tests__
- main_thread
- api/__tests__
- decrypt
- __tests__/__global__
- utils/__tests__
- init/utils/__tests__
- text_displayer/html/__tests__
- tracks_store/__tests__
- manifest/classes
- __tests__
- representation_index/__tests__
- parsers
- containers/isobmff/__tests__
- manifest
- dash
- common
- __tests__
- indexes
- __tests__
- timeline/__tests__
- fast-js-parser
- __tests__
- node_parsers/__tests__
- native-parser
- __tests__
- node_parsers/__tests__
- utils/__tests__
- texttracks
- srt/__tests__
- ttml
- __tests__
- html/__tests__
- __global__
- webvtt
- __tests__
- html/__tests__
- transports
- smooth/isobmff/__tests__
- utils/__tests__
- utils
- __tests__
- languages/__tests__
- request
- __tests__
- tests/integration/scenarios
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
194 files changed
+14541
-21477
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
198 | 198 | | |
199 | 199 | | |
200 | 200 | | |
201 | | - | |
202 | | - | |
203 | | - | |
| 201 | + | |
204 | 202 | | |
205 | 203 | | |
206 | 204 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
183 | 183 | | |
184 | 184 | | |
185 | 185 | | |
186 | | - | |
187 | | - | |
188 | | - | |
| 186 | + | |
189 | 187 | | |
190 | 188 | | |
191 | 189 | | |
| |||
This file was deleted.
0 commit comments