Skip to content

Commit 59abd09

Browse files
authored
test(video-20648): migrate unit test from jest to vitest (#977)
1 parent ef99415 commit 59abd09

File tree

6 files changed

+2330
-424
lines changed

6 files changed

+2330
-424
lines changed

.config/vitest.config.ts

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
import { defineConfig } from 'vitest/config';
2+
import path from 'path';
3+
4+
export default defineConfig({
5+
test: {
6+
globals: true,
7+
environment: 'jsdom',
8+
include: ['test/unit/**/*.test.js'],
9+
exclude: [
10+
'test/*.test.js',
11+
'test/e2e/**/*',
12+
'node_modules/**/*'
13+
],
14+
coverage: {
15+
provider: 'v8',
16+
reporter: ['text', 'json', 'html', 'lcov'],
17+
reportsDirectory: './coverage',
18+
exclude: [
19+
'node_modules/',
20+
'test/',
21+
'webpack/',
22+
'dist/',
23+
'lib/',
24+
'docs/',
25+
'*.config.js',
26+
'.config/'
27+
]
28+
},
29+
testTimeout: 10000,
30+
hookTimeout: 10000,
31+
},
32+
resolve: {
33+
alias: {
34+
'@': path.resolve(process.cwd(), './src'),
35+
'src': path.resolve(process.cwd(), './src'),
36+
'assets': path.resolve(process.cwd(), './src/assets'),
37+
'utils': path.resolve(process.cwd(), './src/utils'),
38+
'components': path.resolve(process.cwd(), './src/components'),
39+
'plugins': path.resolve(process.cwd(), './src/plugins'),
40+
'config': path.resolve(process.cwd(), './src/config'),
41+
'validators': path.resolve(process.cwd(), './src/validators'),
42+
'extended-events': path.resolve(process.cwd(), './src/extended-events.js'),
43+
'video-player.const': path.resolve(process.cwd(), './src/video-player.const.js'),
44+
}
45+
}
46+
});

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ dist/
1414
lib/
1515
.DS_Store
1616

17+
# Test coverage
18+
coverage/
19+
.vitest/
20+
1721
\.history/
1822

1923
# playwright e2e tests

0 commit comments

Comments
 (0)