forked from canalplus/rx-player
-
Notifications
You must be signed in to change notification settings - Fork 1
/
jest.config.js
77 lines (75 loc) · 1.73 KB
/
jest.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
/* eslint-env node */
module.exports = {
// to uncomment to display logs.
// verbose: false,
roots: ["<rootDir>/src"],
preset: "ts-jest",
testEnvironment: "jsdom",
// Without this, Jest just fails when importing rxjs, for some arcane
// ESM-vs-CommonJS reasons linked to how it works internally.
moduleNameMapper: {
"^rxjs$": require.resolve("rxjs"),
},
testMatch: ["**/?(*.)+(spec|test).[jt]s?(x)"],
collectCoverageFrom: [
"src/**/*.ts",
"!src/**/index.ts",
"!**/__tests__/**",
],
transform: {
"^.+\\.tsx?$": [
"ts-jest",
{
tsconfig: {
target: "es2017",
lib: ["es2017", "dom"],
forceConsistentCasingInFileNames: true,
skipLibCheck: false,
noImplicitAny: true,
strict: true,
strictNullChecks: true,
strictPropertyInitialization: true,
noUnusedParameters: true,
noUnusedLocals: true,
types: ["node", "jest"],
module: "es2015",
moduleResolution: "node",
esModuleInterop: true,
typeRoots: [
"./src/typings",
"./node_modules/@types",
],
},
},
],
},
globals: {
__FEATURES__: {
IS_DISABLED: 0,
IS_ENABLED: 1,
BIF_PARSER: 1,
DASH: 1,
DIRECTFILE: 1,
EME: 1,
HTML_SAMI: 1,
HTML_SRT: 1,
HTML_TTML: 1,
HTML_VTT: 1,
LOCAL_MANIFEST: 1,
METAPLAYLIST: 1,
NATIVE_SAMI: 1,
NATIVE_SRT: 1,
NATIVE_TTML: 1,
NATIVE_VTT: 1,
SMOOTH: 1,
},
__ENVIRONMENT__: {
PRODUCTION: 0,
DEV: 1,
CURRENT_ENV: 1,
},
__LOGGER_LEVEL__: {
CURRENT_LEVEL: "\"NONE\"",
},
},
};