forked from imjuni/ctix
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjest.config.js
25 lines (21 loc) · 892 Bytes
/
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
/* eslint-disable import/no-extraneous-dependencies */
const { pathsToModuleNameMapper } = require('ts-jest');
const { parse } = require('jsonc-parser');
const fs = require('fs');
// https://kulshekhar.github.io/ts-jest/docs/getting-started/paths-mapping/#jest-config-with-helper
// ctix tsconfig.json file have comment line so need jsonc-parser
const tsconfig = parse(fs.readFileSync('./tsconfig.json').toString());
module.exports = {
testEnvironment: 'node',
moduleFileExtensions: ['ts', 'tsx', 'js'],
transform: {
'^.+\\.(ts|tsx)$': 'ts-jest',
},
testMatch: ['**/__tests__/*.(ts|tsx)', '**/__test__/*.(ts|tsx)'],
testPathIgnorePatterns: ['/node_modules/', 'example/', 'dist/'],
setupFilesAfterEnv: ['./jest.setup.js'],
testSequencer: './test.spec.js',
moduleNameMapper: pathsToModuleNameMapper(tsconfig.compilerOptions.paths, {
prefix: '<rootDir>/',
}),
};