From 04f8396342a02c3f7836398d44d041f926593d6a Mon Sep 17 00:00:00 2001 From: Mitchell Valine Date: Mon, 10 May 2021 20:51:04 -0700 Subject: [PATCH] chore: init templates use node jest environment Remove usage of the `jsdom` test environment in init templates to speed up unit testing by default. fix: #14630 --- .../lib/init-templates/v1/app/javascript/jest.config.js | 3 +++ .../lib/init-templates/v1/app/typescript/jest.config.js | 1 + .../lib/init-templates/v1/lib/typescript/jest.config.js | 1 + .../lib/init-templates/v1/sample-app/javascript/jest.config.js | 3 +++ .../lib/init-templates/v1/sample-app/typescript/jest.config.js | 1 + .../lib/init-templates/v2/app/javascript/jest.config.js | 3 +++ .../lib/init-templates/v2/app/typescript/jest.config.js | 1 + .../lib/init-templates/v2/lib/typescript/jest.config.js | 1 + .../lib/init-templates/v2/sample-app/javascript/jest.config.js | 3 +++ .../lib/init-templates/v2/sample-app/typescript/jest.config.js | 1 + 10 files changed, 18 insertions(+) create mode 100644 packages/aws-cdk/lib/init-templates/v1/app/javascript/jest.config.js create mode 100644 packages/aws-cdk/lib/init-templates/v1/sample-app/javascript/jest.config.js create mode 100644 packages/aws-cdk/lib/init-templates/v2/app/javascript/jest.config.js create mode 100644 packages/aws-cdk/lib/init-templates/v2/sample-app/javascript/jest.config.js diff --git a/packages/aws-cdk/lib/init-templates/v1/app/javascript/jest.config.js b/packages/aws-cdk/lib/init-templates/v1/app/javascript/jest.config.js new file mode 100644 index 0000000000000..668e089fb02b3 --- /dev/null +++ b/packages/aws-cdk/lib/init-templates/v1/app/javascript/jest.config.js @@ -0,0 +1,3 @@ +module.exports = { + testEnvironment: "node" +} diff --git a/packages/aws-cdk/lib/init-templates/v1/app/typescript/jest.config.js b/packages/aws-cdk/lib/init-templates/v1/app/typescript/jest.config.js index 772f974903b79..08263b8954a42 100644 --- a/packages/aws-cdk/lib/init-templates/v1/app/typescript/jest.config.js +++ b/packages/aws-cdk/lib/init-templates/v1/app/typescript/jest.config.js @@ -1,4 +1,5 @@ module.exports = { + testEnvironment: 'node', roots: ['/test'], testMatch: ['**/*.test.ts'], transform: { diff --git a/packages/aws-cdk/lib/init-templates/v1/lib/typescript/jest.config.js b/packages/aws-cdk/lib/init-templates/v1/lib/typescript/jest.config.js index 772f974903b79..08263b8954a42 100644 --- a/packages/aws-cdk/lib/init-templates/v1/lib/typescript/jest.config.js +++ b/packages/aws-cdk/lib/init-templates/v1/lib/typescript/jest.config.js @@ -1,4 +1,5 @@ module.exports = { + testEnvironment: 'node', roots: ['/test'], testMatch: ['**/*.test.ts'], transform: { diff --git a/packages/aws-cdk/lib/init-templates/v1/sample-app/javascript/jest.config.js b/packages/aws-cdk/lib/init-templates/v1/sample-app/javascript/jest.config.js new file mode 100644 index 0000000000000..95495de92eb8c --- /dev/null +++ b/packages/aws-cdk/lib/init-templates/v1/sample-app/javascript/jest.config.js @@ -0,0 +1,3 @@ +module.exports = { + testEnvironment: 'node' +} diff --git a/packages/aws-cdk/lib/init-templates/v1/sample-app/typescript/jest.config.js b/packages/aws-cdk/lib/init-templates/v1/sample-app/typescript/jest.config.js index 772f974903b79..08263b8954a42 100644 --- a/packages/aws-cdk/lib/init-templates/v1/sample-app/typescript/jest.config.js +++ b/packages/aws-cdk/lib/init-templates/v1/sample-app/typescript/jest.config.js @@ -1,4 +1,5 @@ module.exports = { + testEnvironment: 'node', roots: ['/test'], testMatch: ['**/*.test.ts'], transform: { diff --git a/packages/aws-cdk/lib/init-templates/v2/app/javascript/jest.config.js b/packages/aws-cdk/lib/init-templates/v2/app/javascript/jest.config.js new file mode 100644 index 0000000000000..95495de92eb8c --- /dev/null +++ b/packages/aws-cdk/lib/init-templates/v2/app/javascript/jest.config.js @@ -0,0 +1,3 @@ +module.exports = { + testEnvironment: 'node' +} diff --git a/packages/aws-cdk/lib/init-templates/v2/app/typescript/jest.config.js b/packages/aws-cdk/lib/init-templates/v2/app/typescript/jest.config.js index 772f974903b79..08263b8954a42 100644 --- a/packages/aws-cdk/lib/init-templates/v2/app/typescript/jest.config.js +++ b/packages/aws-cdk/lib/init-templates/v2/app/typescript/jest.config.js @@ -1,4 +1,5 @@ module.exports = { + testEnvironment: 'node', roots: ['/test'], testMatch: ['**/*.test.ts'], transform: { diff --git a/packages/aws-cdk/lib/init-templates/v2/lib/typescript/jest.config.js b/packages/aws-cdk/lib/init-templates/v2/lib/typescript/jest.config.js index 772f974903b79..08263b8954a42 100644 --- a/packages/aws-cdk/lib/init-templates/v2/lib/typescript/jest.config.js +++ b/packages/aws-cdk/lib/init-templates/v2/lib/typescript/jest.config.js @@ -1,4 +1,5 @@ module.exports = { + testEnvironment: 'node', roots: ['/test'], testMatch: ['**/*.test.ts'], transform: { diff --git a/packages/aws-cdk/lib/init-templates/v2/sample-app/javascript/jest.config.js b/packages/aws-cdk/lib/init-templates/v2/sample-app/javascript/jest.config.js new file mode 100644 index 0000000000000..95495de92eb8c --- /dev/null +++ b/packages/aws-cdk/lib/init-templates/v2/sample-app/javascript/jest.config.js @@ -0,0 +1,3 @@ +module.exports = { + testEnvironment: 'node' +} diff --git a/packages/aws-cdk/lib/init-templates/v2/sample-app/typescript/jest.config.js b/packages/aws-cdk/lib/init-templates/v2/sample-app/typescript/jest.config.js index 772f974903b79..08263b8954a42 100644 --- a/packages/aws-cdk/lib/init-templates/v2/sample-app/typescript/jest.config.js +++ b/packages/aws-cdk/lib/init-templates/v2/sample-app/typescript/jest.config.js @@ -1,4 +1,5 @@ module.exports = { + testEnvironment: 'node', roots: ['/test'], testMatch: ['**/*.test.ts'], transform: {