Skip to content

Commit afc1ac3

Browse files
committed
Huh huh
1 parent e159bc9 commit afc1ac3

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

packages/aws-cdk-lib/jest.config.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,21 @@
11
// @ts-check
22
const baseConfig = require('@aws-cdk/cdk-build-tools/config/jest.config');
3+
const ext = require('@aws-cdk/cdk-build-tools/config/ext');
34

45
/** @type {import('ts-jest').JestConfigWithTsJest} */
56
const config = {
67
...baseConfig,
78

89
// Different than usual
910
testMatch: [
10-
`<rootDir>/**/test/**/?(*.)+(test).ts`,
11+
`<rootDir>/**/test/**/?(*.)+(test).${ext}`,
1112
],
13+
14+
transform: {
15+
"\\.jsx?$": ["babel-jest", {}],
16+
'^.+\\.tsx?$': ['ts-jest', { tsConfig: 'tsconfig.tests.json' }],
17+
},
18+
1219
coveragePathIgnorePatterns: ['\\.generated\\.[jt]s$', '<rootDir>/.*/test/', '.warnings.jsii.js$', '/node_modules/'],
1320

1421
// Massive parallellism leads to common timeouts
@@ -21,7 +28,7 @@ const config = {
2128
},
2229
},
2330

24-
testEnvironment: './testhelpers/jest-bufferedconsole.ts',
31+
testEnvironment: `./testhelpers/jest-bufferedconsole.${ext}`,
2532
};
2633

2734
(config.globals?.['ts-jest'] ?? {}).tsconfig = 'tsconfig.tests.json';

tools/@aws-cdk/cdk-build-tools/config/jest.config.js

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,6 @@ if ('aws-cdk-lib' in (thisPackagesPackageJson.devDependencies ?? {})) {
1919
// @ts-check
2020
/** @type {import('jest').Config} */
2121
const config = {
22-
globals: {
23-
'ts-jest': {
24-
tsConfig: 'tsconfig.json'
25-
}
26-
},
27-
2822
// The preset deals with preferring TS over JS
2923
moduleFileExtensions: [
3024
// .ts first to prefer a ts over a js if present
@@ -38,7 +32,7 @@ const config = {
3832
// make sure `jest.mock` calls are hoisted to the top of every test file.
3933
transform: {
4034
"\\.jsx?$": ["babel-jest", {}],
41-
'^.+\\.tsx?$': ['ts-jest', {}],
35+
'^.+\\.tsx?$': ['ts-jest', { tsConfig: 'tsconfig.json' }],
4236
},
4337
// Jest is resource greedy so this shouldn't be more than 50%
4438
maxWorkers: '50%',
@@ -66,4 +60,4 @@ const config = {
6660
setupFilesAfterEnv,
6761
};
6862

69-
module.exports = config;
63+
module.exports = config;

0 commit comments

Comments
 (0)