-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.config.cjs
72 lines (71 loc) · 2.02 KB
/
jest.config.cjs
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
module.exports = {
//testEnvironment: "node",
// Performance optimazation
cacheDirectory: "./.cache",
maxWorkers: 3,
testTimeout: 20000,
testEnvironmentOptions: {
"jest-playwright": {
browsers: ["chromium"],
launchOptions: {
// executablePath: process.env.PLAYWRIGHT_CHROME_EXECUTABLE_PATH,
chromium: {
headless: true,
// executablePath: "/home/x/.guix-profile/bin/chromium",
},
},
},
},
verbose: true,
errorOnDeprecated: true,
preset: "jest-playwright-preset",
bail: 1,
watchPlugins: [
["jest-watch-typeahead/filename", "jest-watch-typeahead/testname"],
["jest-watch-repeat", { key: "r", prompt: "repeat test runs." }],
[
"jest-watch-continue",
{
key: "n",
prompt: "start continue mode",
},
],
[
"jest-watch-random",
{ key: "R", prompt: "randomly pick some test suites to run" },
],
[
"jest-watch-suspend",
{
// override key press
key: "s",
// override prompt
prompt: "suspend watch mode",
// starts in suspend mode
"suspend-on-start": true,
},
],
],
transform: {
"^.+\\.svelte$": [
"svelte-jester",
{
preprocess: "./svelte.config.js",
},
],
"^.+\\.ts$": "ts-jest",
"^.+\\.js$": "ts-jest",
},
moduleFileExtensions: ["js", "ts", "svelte"],
moduleNameMapper: {
"^\\$lib(.*)$": "<rootDir>/src/lib$1",
"^\\$app(.*)$": [
"<rootDir>/.svelte-kit/dev/runtime/app$1",
"<rootDir>/.svelte-kit/build/runtime/app$1",
],
},
setupFilesAfterEnv: [
// "@testing-library/jest-dom/extend-expect",
"<rootDir>/jest-setup.ts",
],
};