From 7ff772634b6fb4a0f5ab37f1dadb96a6fdfb475b Mon Sep 17 00:00:00 2001 From: Andrew Connell Date: Mon, 14 Oct 2019 15:51:04 -0400 Subject: [PATCH] fix to inherit project's tsconfig for tests - previous fix in 1.3.1 introduced regression - this configures ts-jest prepreocessor to use same TSC compiler options as the project, but makes one mod to address issue that was fixed in 1.3.1 - incorporates fix submitted in PR #10, but implemented in a different way --- jest-preset.json | 2 +- package.json | 2 +- tsconfig.json | 3 +-- tsconfig.ts-jest.json | 6 ++++++ 4 files changed, 9 insertions(+), 4 deletions(-) create mode 100644 tsconfig.ts-jest.json diff --git a/jest-preset.json b/jest-preset.json index 53f7ab6..6428370 100644 --- a/jest-preset.json +++ b/jest-preset.json @@ -8,7 +8,7 @@ ], "globals": { "ts-jest": { - "tsConfig": "node_modules/@voitanos/jest-preset-spfx-react16/tsconfig.json" + "tsConfig": "node_modules/@voitanos/jest-preset-spfx-react16/tsconfig.ts-jest.json" } }, "moduleFileExtensions": [ diff --git a/package.json b/package.json index 097c2a4..a9832e0 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@voitanos/jest-preset-spfx-react16", "description": "Jest preset configuration for SharePoint Framework projects that leverage React v16 (SPFx >=1.7.0).", - "version": "1.3.1", + "version": "1.3.2", "license": "MIT", "dependencies": { "@types/enzyme-adapter-react-16": "1.0.5", diff --git a/tsconfig.json b/tsconfig.json index ee9b1a0..caf017d 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -8,8 +8,7 @@ "baseUrl": ".", "allowJs": true, "types": ["node"], - "jsx": "react", - "esModuleInterop": true + "jsx": "react" }, "include": [ "postinstall/*.ts" diff --git a/tsconfig.ts-jest.json b/tsconfig.ts-jest.json new file mode 100644 index 0000000..5d908e5 --- /dev/null +++ b/tsconfig.ts-jest.json @@ -0,0 +1,6 @@ +{ + "extends": "../../../tsconfig.json", + "compilerOptions": { + "esModuleInterop": true + } +} \ No newline at end of file