2020-10-20 23:13:08 +08:00
|
|
|
const path = require('path')
|
2020-10-26 22:34:14 +08:00
|
|
|
const process = require('process')
|
2019-09-23 09:28:27 +08:00
|
|
|
|
2020-10-26 22:34:14 +08:00
|
|
|
/** @typedef {import('ts-jest')} */
|
|
|
|
/** @type {import('@jest/types').Config.InitialOptions} */
|
2018-11-03 05:11:51 +08:00
|
|
|
module.exports = {
|
2020-11-21 00:00:18 +08:00
|
|
|
testPathIgnorePatterns: ['<rootDir>/docs'],
|
2020-10-20 23:13:08 +08:00
|
|
|
setupFilesAfterEnv: ['<rootDir>/tests/_setup.ts'],
|
|
|
|
preset: 'ts-jest',
|
|
|
|
testEnvironment: 'node',
|
|
|
|
watchPlugins: ['jest-watch-typeahead/filename', 'jest-watch-typeahead/testname'],
|
2019-01-22 03:29:30 +08:00
|
|
|
globals: {
|
2020-10-20 23:13:08 +08:00
|
|
|
'ts-jest': {
|
2020-10-26 22:34:14 +08:00
|
|
|
diagnostics: Boolean(process.env.CI)
|
|
|
|
? {
|
|
|
|
pretty: true,
|
|
|
|
pathRegex: '\\.(spec|test)\\.ts$',
|
|
|
|
}
|
|
|
|
: false,
|
2019-01-22 03:29:30 +08:00
|
|
|
},
|
|
|
|
},
|
2020-10-20 23:13:08 +08:00
|
|
|
collectCoverageFrom: ['src/**/*'],
|
2020-11-22 06:02:58 +08:00
|
|
|
testSequencer: '<rootDir>/tests/__helpers/sequencer.js',
|
2020-10-20 23:13:08 +08:00
|
|
|
}
|