-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.config.js
47 lines (45 loc) · 1.34 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
import path from 'node:path';
import { fileURLToPath } from 'node:url';
const dirname = path.dirname(fileURLToPath(import.meta.url));
export default {
verbose: true,
testEnvironment: 'node',
setupFilesAfterEnv: ['jest-extended/all'],
collectCoverage: true,
coverageReporters: ['json', 'lcov', 'text', 'html'],
coverageDirectory: 'coverage',
collectCoverageFrom: [
'<rootDir>/asset/**/*.ts',
'!<rootDir>/asset/src/index.ts',
'!<rootDir>/packages/*/**/*.ts',
'!<rootDir>/packages/*/test/**',
'!<rootDir>/**/coverage/**',
'!<rootDir>/**/*.d.ts',
'!<rootDir>/**/dist/**',
'!<rootDir>/**/coverage/**'
],
testMatch: [
'<rootDir>/test/**/*-spec.{ts,js}',
'<rootDir>/test/*-spec.{ts,js}'
],
moduleNameMapper: {
'^@terascope/standard-asset-apis$': path.join(dirname, '/packages/standard-asset-apis/src/index.ts'),
'^(\\.{1,2}/.*)\\.js$': '$1',
},
preset: 'ts-jest',
extensionsToTreatAsEsm: ['.ts'],
globals: {
ignoreDirectories: ['dist'],
availableExtensions: ['.js', '.ts', '.mjs']
},
transform: {
'\\.[jt]sx?$': ['ts-jest',
{
isolatedModules: true,
useESM: true
}]
},
setupFiles: [
'<rootDir>/test/test.setup.js'
]
};