-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathjest.e2e.config.js
45 lines (43 loc) · 1.31 KB
/
jest.e2e.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
const { compilerOptions } = require('./tsconfig.json')
const { pathsToModuleNameMapper } = require('ts-jest')
const roots = ['<rootDir>/src', '<rootDir>/e2e'];
const moduleDirectories = [
"node_modules/",
"src",
];
const tsconfig = "./tsconfig.e2e.json";
process.env.USE_CLI = 'true';
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
testRunner: 'jest-circus/runner',
moduleFileExtensions: ["js", "ts"],
transform: {
"^.+\\.ts$": [ "ts-jest", {
"tsconfig": tsconfig,
}]
},
moduleDirectories,
modulePaths: [compilerOptions.baseUrl],
moduleNameMapper: {
// 'node:fs': '<rootDir>/__mocks__/fs.ts',
// 'node:os': '<rootDir>/__mocks__/os.ts',
// 'better-sqlite3': '<rootDir>/__mocks__/better-sqlite3.ts',
// 'csv-parser': '<rootDir>/__mocks__/csv-parser.ts',
// '^(\\.{1,2}/.*)\\.js$': '$1', // JavaScriptファイルの拡張子を補完
...pathsToModuleNameMapper(compilerOptions.paths),
},
// テストファイルの場所
roots,
// transformIgnorePatterns: [
// // esmが使われているパッケージを除いてIgnoreする
// // `node_modules/(?!(${esmPackages.join("|")})/)`,
// ],
testRegex: 'e2e/__tests__/.*\\.(test|spec)?\\.ts$',
testPathIgnorePatterns: [
"lib/",
"build/",
"node_modules/",
"\\.skip\\.ts$",
],
};