forked from SourceXXL/alian_structure-api
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjest.config.js
More file actions
29 lines (29 loc) · 1.13 KB
/
Copy pathjest.config.js
File metadata and controls
29 lines (29 loc) · 1.13 KB
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
module.exports = {
moduleFileExtensions: ['js', 'json', 'ts'],
rootDir: 'src',
testRegex: '.*\\.spec\\.ts$',
transform: {
// Some deps pulled in by @stellar/stellar-sdk (uint8array-extras, @noble/*,
// smol-toml, eventsource) publish untranspiled ESM (`export`/`import`) in
// their .js. Jest ignores node_modules by default (see
// transformIgnorePatterns below); down-level just those files with an
// isolated, no-type-check transpile so they load under CommonJS.
'.+/node_modules/.+\\.js$': ['ts-jest', { isolatedModules: true }],
'^.+\\.(t|j)s$': 'ts-jest',
},
transformIgnorePatterns: [
// Keep ignoring node_modules EXCEPT the ESM-only chain under
// @stellar/stellar-sdk, which must be transpiled to load in Jest.
'/node_modules/(?!(@stellar|@noble|@exodus|stellar-base|uint8array-extras|smol-toml|eventsource)/)',
'\\.pnp\\.[^\\/]+$',
],
moduleNameMapper: {
// Resolve absolute "src/..." imports (tsconfig baseUrl) under rootDir.
'^src/(.*)$': '<rootDir>/$1',
},
collectCoverageFrom: [
'**/*.(t|j)s',
],
coverageDirectory: '../coverage',
testEnvironment: 'node',
};