skuba 3.17.0-beta.1 → 3.17.0-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/jest-preset.js +6 -24
- package/package.json +1 -1
package/jest-preset.js
CHANGED
|
@@ -1,28 +1,14 @@
|
|
|
1
|
-
const { defaults
|
|
1
|
+
const { defaults } = require('ts-jest/presets');
|
|
2
2
|
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Resolved path of the `ts-jest` preset.
|
|
7
|
-
*
|
|
8
|
-
* This allows Jest to resolve the preset even if it is installed to a nested
|
|
9
|
-
* `./node_modules/skuba/node_modules/ts-jest` directory.
|
|
10
|
-
*/
|
|
11
|
-
const TS_JEST_PATH = require.resolve(TS_JEST_NAME);
|
|
12
|
-
|
|
13
|
-
// Rewrite `ts-jest` transformations using our resolved `TS_JEST_PATH`.
|
|
14
|
-
const tsJestTransform = Object.fromEntries(
|
|
15
|
-
Object.entries(tsJestDefaults.transform).map(([key, value]) => [
|
|
16
|
-
key,
|
|
17
|
-
value === TS_JEST_NAME ? TS_JEST_PATH : value,
|
|
18
|
-
]),
|
|
19
|
-
);
|
|
3
|
+
const { createModuleNameMapper } = require('./jest/moduleNameMapper');
|
|
4
|
+
const { transform } = require('./jest/transform');
|
|
20
5
|
|
|
21
6
|
/** @type {import('@jest/types').Config.InitialOptions} */
|
|
22
7
|
module.exports = {
|
|
23
|
-
...
|
|
8
|
+
...defaults,
|
|
24
9
|
|
|
25
|
-
|
|
10
|
+
moduleNameMapper: createModuleNameMapper(),
|
|
11
|
+
transform,
|
|
26
12
|
|
|
27
13
|
collectCoverageFrom: [
|
|
28
14
|
'**/*.ts',
|
|
@@ -35,10 +21,6 @@ module.exports = {
|
|
|
35
21
|
'!<rootDir>/jest.*.ts',
|
|
36
22
|
],
|
|
37
23
|
coverageDirectory: 'coverage',
|
|
38
|
-
moduleNameMapper: {
|
|
39
|
-
'^src$': '<rootDir>/src',
|
|
40
|
-
'^src/(.+)$': '<rootDir>/src/$1',
|
|
41
|
-
},
|
|
42
24
|
testEnvironment: 'node',
|
|
43
25
|
testPathIgnorePatterns: [
|
|
44
26
|
'/node_modules.*/',
|