diff --git a/e2e/__tests__/__snapshots__/compiler-host.test.ts.snap b/e2e/__tests__/__snapshots__/compiler-host.test.ts.snap index 7418daca91..1f5899ccb8 100644 --- a/e2e/__tests__/__snapshots__/compiler-host.test.ts.snap +++ b/e2e/__tests__/__snapshots__/compiler-host.test.ts.snap @@ -49,8 +49,7 @@ exports[`With compilerHost enabled and incremental disabled should pass using te ===[ STDOUT ]=================================================================== ===[ STDERR ]=================================================================== - ts-jest[ts-compiler] (WARN) TypeScript diagnostics (customize using \`[jest-config].globals.ts-jest.diagnostics\` option): - main.spec.ts:4:9 - error TS2322: Type 'number' is not assignable to type 'string'. + ts-jest[ts-compiler] (WARN) main.spec.ts:4:9 - error TS2322: Type 'number' is not assignable to type 'string'. 4 const x: string = g(5) ~ @@ -71,8 +70,7 @@ exports[`With compilerHost enabled and incremental disabled should pass using te ===[ STDOUT ]=================================================================== ===[ STDERR ]=================================================================== - ts-jest[ts-compiler] (WARN) TypeScript diagnostics (customize using \`[jest-config].globals.ts-jest.diagnostics\` option): - main.spec.ts:4:9 - error TS2322: Type 'number' is not assignable to type 'string'. + ts-jest[ts-compiler] (WARN) main.spec.ts:4:9 - error TS2322: Type 'number' is not assignable to type 'string'. 4 const x: string = g(5) ~ @@ -93,8 +91,7 @@ exports[`With compilerHost enabled and incremental disabled should pass using te ===[ STDOUT ]=================================================================== ===[ STDERR ]=================================================================== - ts-jest[ts-compiler] (WARN) TypeScript diagnostics (customize using \`[jest-config].globals.ts-jest.diagnostics\` option): - main.spec.ts:4:9 - error TS2322: Type 'number' is not assignable to type 'string'. + ts-jest[ts-compiler] (WARN) main.spec.ts:4:9 - error TS2322: Type 'number' is not assignable to type 'string'. 4 const x: string = g(5) ~ @@ -158,8 +155,7 @@ exports[`With compilerHost enabled and incremental enabled should pass using tem ===[ STDOUT ]=================================================================== ===[ STDERR ]=================================================================== - ts-jest[ts-compiler] (WARN) TypeScript diagnostics (customize using \`[jest-config].globals.ts-jest.diagnostics\` option): - main.spec.ts:4:9 - error TS2322: Type 'number' is not assignable to type 'string'. + ts-jest[ts-compiler] (WARN) main.spec.ts:4:9 - error TS2322: Type 'number' is not assignable to type 'string'. 4 const x: string = g(5) ~ @@ -180,8 +176,7 @@ exports[`With compilerHost enabled and incremental enabled should pass using tem ===[ STDOUT ]=================================================================== ===[ STDERR ]=================================================================== - ts-jest[ts-compiler] (WARN) TypeScript diagnostics (customize using \`[jest-config].globals.ts-jest.diagnostics\` option): - main.spec.ts:4:9 - error TS2322: Type 'number' is not assignable to type 'string'. + ts-jest[ts-compiler] (WARN) main.spec.ts:4:9 - error TS2322: Type 'number' is not assignable to type 'string'. 4 const x: string = g(5) ~ @@ -202,8 +197,7 @@ exports[`With compilerHost enabled and incremental enabled should pass using tem ===[ STDOUT ]=================================================================== ===[ STDERR ]=================================================================== - ts-jest[ts-compiler] (WARN) TypeScript diagnostics (customize using \`[jest-config].globals.ts-jest.diagnostics\` option): - main.spec.ts:4:9 - error TS2322: Type 'number' is not assignable to type 'string'. + ts-jest[ts-compiler] (WARN) main.spec.ts:4:9 - error TS2322: Type 'number' is not assignable to type 'string'. 4 const x: string = g(5) ~ diff --git a/e2e/__tests__/__snapshots__/diagnostics.test.ts.snap b/e2e/__tests__/__snapshots__/diagnostics.test.ts.snap index 99dd172cfb..1d81a46716 100644 --- a/e2e/__tests__/__snapshots__/diagnostics.test.ts.snap +++ b/e2e/__tests__/__snapshots__/diagnostics.test.ts.snap @@ -9,7 +9,6 @@ exports[`With diagnostics, first throws should fail using template "default" 1`] FAIL ./main.spec.ts ● Test suite failed to run - TypeScript diagnostics (customize using \`[jest-config].globals.ts-jest.diagnostics\` option): main.ts:2:3 - error TS2322: Type 'string' is not assignable to type 'number'. 2 return input @@ -32,7 +31,6 @@ exports[`With diagnostics, first throws should fail using template "with-babel-7 FAIL ./main.spec.ts ● Test suite failed to run - TypeScript diagnostics (customize using \`[jest-config].globals.ts-jest.diagnostics\` option): main.ts:2:3 - error TS2322: Type 'string' is not assignable to type 'number'. 2 return input @@ -55,7 +53,6 @@ exports[`With diagnostics, first throws should fail using template "with-babel-7 FAIL ./main.spec.ts ● Test suite failed to run - TypeScript diagnostics (customize using \`[jest-config].globals.ts-jest.diagnostics\` option): main.ts:2:3 - error TS2322: Type 'string' is not assignable to type 'number'. 2 return input @@ -78,7 +75,6 @@ exports[`With diagnostics, first throws should fail using template "with-typescr FAIL ./main.spec.ts ● Test suite failed to run - TypeScript diagnostics (customize using \`[jest-config].globals.ts-jest.diagnostics\` option): main.ts:2:3 - error TS2322: Type 'string' is not assignable to type 'number'. 2 return input @@ -98,8 +94,7 @@ exports[`With diagnostics, warn only should pass using template "default" 1`] = ===[ STDOUT ]=================================================================== ===[ STDERR ]=================================================================== - ts-jest[ts-compiler] (WARN) TypeScript diagnostics (customize using \`[jest-config].globals.ts-jest.diagnostics\` option): - main.ts:2:3 - error TS2322: Type 'string' is not assignable to type 'number'. + ts-jest[ts-compiler] (WARN) main.ts:2:3 - error TS2322: Type 'string' is not assignable to type 'number'. 2 return input ~~~~~~~~~~~~ @@ -120,8 +115,7 @@ exports[`With diagnostics, warn only should pass using template "with-babel-7" 1 ===[ STDOUT ]=================================================================== ===[ STDERR ]=================================================================== - ts-jest[ts-compiler] (WARN) TypeScript diagnostics (customize using \`[jest-config].globals.ts-jest.diagnostics\` option): - main.ts:2:3 - error TS2322: Type 'string' is not assignable to type 'number'. + ts-jest[ts-compiler] (WARN) main.ts:2:3 - error TS2322: Type 'string' is not assignable to type 'number'. 2 return input ~~~~~~~~~~~~ @@ -142,8 +136,7 @@ exports[`With diagnostics, warn only should pass using template "with-babel-7-st ===[ STDOUT ]=================================================================== ===[ STDERR ]=================================================================== - ts-jest[ts-compiler] (WARN) TypeScript diagnostics (customize using \`[jest-config].globals.ts-jest.diagnostics\` option): - main.ts:2:3 - error TS2322: Type 'string' is not assignable to type 'number'. + ts-jest[ts-compiler] (WARN) main.ts:2:3 - error TS2322: Type 'string' is not assignable to type 'number'. 2 return input ~~~~~~~~~~~~ @@ -164,8 +157,7 @@ exports[`With diagnostics, warn only should pass using template "with-typescript ===[ STDOUT ]=================================================================== ===[ STDERR ]=================================================================== - ts-jest[ts-compiler] (WARN) TypeScript diagnostics (customize using \`[jest-config].globals.ts-jest.diagnostics\` option): - main.ts:2:3 - error TS2322: Type 'string' is not assignable to type 'number'. + ts-jest[ts-compiler] (WARN) main.ts:2:3 - error TS2322: Type 'string' is not assignable to type 'number'. 2 return input ~~~~~~~~~~~~ diff --git a/e2e/__tests__/__snapshots__/test-helpers.test.ts.snap b/e2e/__tests__/__snapshots__/test-helpers.test.ts.snap index 0b575f59bd..737d1d55a2 100644 --- a/e2e/__tests__/__snapshots__/test-helpers.test.ts.snap +++ b/e2e/__tests__/__snapshots__/test-helpers.test.ts.snap @@ -10,7 +10,6 @@ exports[`test-helpers 1`] = ` FAIL ./fail.spec.ts ● Test suite failed to run - TypeScript diagnostics (customize using \`[jest-config].globals.ts-jest.diagnostics\` option): fail.spec.ts:7:22 - error TS2554: Expected 0 arguments, but got 1. 7 expect(mocked(foo)('hello')).toBeUndefined() @@ -41,7 +40,6 @@ exports[`with esModuleInterop set to false 1`] = ` FAIL ./fail.spec.ts ● Test suite failed to run - TypeScript diagnostics (customize using \`[jest-config].globals.ts-jest.diagnostics\` option): fail.spec.ts:7:22 - error TS2554: Expected 0 arguments, but got 1. 7 expect(mocked(foo)('hello')).toBeUndefined() diff --git a/e2e/__tests__/module-kinds/__snapshots__/amd.test.ts.snap b/e2e/__tests__/module-kinds/__snapshots__/amd.test.ts.snap index d299f51378..914c0083ba 100644 --- a/e2e/__tests__/module-kinds/__snapshots__/amd.test.ts.snap +++ b/e2e/__tests__/module-kinds/__snapshots__/amd.test.ts.snap @@ -6,13 +6,11 @@ exports[`run with options: {"module":"amd","allowSyntheticDefaultImports":false} ===[ STDOUT ]=================================================================== ===[ STDERR ]=================================================================== - ts-jest[config] (WARN) TypeScript diagnostics (customize using \`[jest-config].globals.ts-jest.diagnostics\` option): - message TS151001: If you have issues related to imports, you should consider setting \`esModuleInterop\` to \`true\` in your TypeScript configuration file (usually \`tsconfig.json\`). See https://blogs.msdn.microsoft.com/typescript/2018/01/31/announcing-typescript-2-7/#easier-ecmascript-module-interoperability for more information. + ts-jest[config] (WARN) message TS151001: If you have issues related to imports, you should consider setting \`esModuleInterop\` to \`true\` in your TypeScript configuration file (usually \`tsconfig.json\`). See https://blogs.msdn.microsoft.com/typescript/2018/01/31/announcing-typescript-2-7/#easier-ecmascript-module-interoperability for more information. PASS ./ts-jest-tools.spec.ts PASS ./import-legacy.spec.ts PASS ./import-star.spec.ts - ts-jest[ts-compiler] (WARN) TypeScript diagnostics (customize using \`[jest-config].globals.ts-jest.diagnostics\` option): - import-default.spec.ts:1:8 - error TS1259: Module '"/lib"' can only be default-imported using the 'esModuleInterop' flag + ts-jest[ts-compiler] (WARN) import-default.spec.ts:1:8 - error TS1259: Module '"/lib"' can only be default-imported using the 'esModuleInterop' flag 1 import lib from './lib' ~~~ @@ -88,8 +86,7 @@ exports[`run with options: {"module":"amd","esModuleInterop":false} 1`] = ` ===[ STDOUT ]=================================================================== ===[ STDERR ]=================================================================== - ts-jest[config] (WARN) TypeScript diagnostics (customize using \`[jest-config].globals.ts-jest.diagnostics\` option): - message TS151001: If you have issues related to imports, you should consider setting \`esModuleInterop\` to \`true\` in your TypeScript configuration file (usually \`tsconfig.json\`). See https://blogs.msdn.microsoft.com/typescript/2018/01/31/announcing-typescript-2-7/#easier-ecmascript-module-interoperability for more information. + ts-jest[config] (WARN) message TS151001: If you have issues related to imports, you should consider setting \`esModuleInterop\` to \`true\` in your TypeScript configuration file (usually \`tsconfig.json\`). See https://blogs.msdn.microsoft.com/typescript/2018/01/31/announcing-typescript-2-7/#easier-ecmascript-module-interoperability for more information. PASS ./ts-jest-tools.spec.ts PASS ./import-legacy.spec.ts PASS ./import-star.spec.ts @@ -127,8 +124,7 @@ exports[`run with options: {"module":"amd","esModuleInterop":true} 1`] = ` ===[ STDERR ]=================================================================== PASS ./ts-jest-tools.spec.ts PASS ./import-legacy.spec.ts - ts-jest[ts-compiler] (WARN) TypeScript diagnostics (customize using \`[jest-config].globals.ts-jest.diagnostics\` option): - import-star.spec.ts:5:10 - error TS2349: This expression is not callable. + ts-jest[ts-compiler] (WARN) import-star.spec.ts:5:10 - error TS2349: This expression is not callable. Type 'typeof lib' has no call signatures. 5 expect(lib()).toBe('foo') @@ -172,8 +168,7 @@ exports[`run with options: {"module":"amd"} 1`] = ` ===[ STDOUT ]=================================================================== ===[ STDERR ]=================================================================== - ts-jest[config] (WARN) TypeScript diagnostics (customize using \`[jest-config].globals.ts-jest.diagnostics\` option): - message TS151001: If you have issues related to imports, you should consider setting \`esModuleInterop\` to \`true\` in your TypeScript configuration file (usually \`tsconfig.json\`). See https://blogs.msdn.microsoft.com/typescript/2018/01/31/announcing-typescript-2-7/#easier-ecmascript-module-interoperability for more information. + ts-jest[config] (WARN) message TS151001: If you have issues related to imports, you should consider setting \`esModuleInterop\` to \`true\` in your TypeScript configuration file (usually \`tsconfig.json\`). See https://blogs.msdn.microsoft.com/typescript/2018/01/31/announcing-typescript-2-7/#easier-ecmascript-module-interoperability for more information. PASS ./ts-jest-tools.spec.ts PASS ./import-legacy.spec.ts PASS ./import-star.spec.ts diff --git a/e2e/__tests__/module-kinds/__snapshots__/commonjs.test.ts.snap b/e2e/__tests__/module-kinds/__snapshots__/commonjs.test.ts.snap index 7bf6588831..16ae3ec14b 100644 --- a/e2e/__tests__/module-kinds/__snapshots__/commonjs.test.ts.snap +++ b/e2e/__tests__/module-kinds/__snapshots__/commonjs.test.ts.snap @@ -9,8 +9,7 @@ exports[`run with options: {"module":"commonjs","allowSyntheticDefaultImports":f PASS ./ts-jest-tools.spec.ts PASS ./import-legacy.spec.ts PASS ./import-star.spec.ts - ts-jest[ts-compiler] (WARN) TypeScript diagnostics (customize using \`[jest-config].globals.ts-jest.diagnostics\` option): - import-default.spec.ts:1:8 - error TS1259: Module '"/lib"' can only be default-imported using the 'esModuleInterop' flag + ts-jest[ts-compiler] (WARN) import-default.spec.ts:1:8 - error TS1259: Module '"/lib"' can only be default-imported using the 'esModuleInterop' flag 1 import lib from './lib' ~~~ @@ -89,8 +88,7 @@ exports[`run with options: {"module":"commonjs","esModuleInterop":false} 1`] = ` PASS ./ts-jest-tools.spec.ts PASS ./import-legacy.spec.ts PASS ./import-star.spec.ts - ts-jest[ts-compiler] (WARN) TypeScript diagnostics (customize using \`[jest-config].globals.ts-jest.diagnostics\` option): - import-default.spec.ts:1:8 - error TS1259: Module '"/lib"' can only be default-imported using the 'esModuleInterop' flag + ts-jest[ts-compiler] (WARN) import-default.spec.ts:1:8 - error TS1259: Module '"/lib"' can only be default-imported using the 'esModuleInterop' flag 1 import lib from './lib' ~~~ @@ -133,8 +131,7 @@ exports[`run with options: {"module":"commonjs","esModuleInterop":true} 1`] = ` ===[ STDERR ]=================================================================== PASS ./ts-jest-tools.spec.ts PASS ./import-legacy.spec.ts - ts-jest[ts-compiler] (WARN) TypeScript diagnostics (customize using \`[jest-config].globals.ts-jest.diagnostics\` option): - import-star.spec.ts:5:10 - error TS2349: This expression is not callable. + ts-jest[ts-compiler] (WARN) import-star.spec.ts:5:10 - error TS2349: This expression is not callable. Type 'typeof lib' has no call signatures. 5 expect(lib()).toBe('foo') @@ -181,8 +178,7 @@ exports[`run with options: {"module":"commonjs"} 1`] = ` PASS ./ts-jest-tools.spec.ts PASS ./import-legacy.spec.ts PASS ./import-star.spec.ts - ts-jest[ts-compiler] (WARN) TypeScript diagnostics (customize using \`[jest-config].globals.ts-jest.diagnostics\` option): - import-default.spec.ts:1:8 - error TS1259: Module '"/lib"' can only be default-imported using the 'esModuleInterop' flag + ts-jest[ts-compiler] (WARN) import-default.spec.ts:1:8 - error TS1259: Module '"/lib"' can only be default-imported using the 'esModuleInterop' flag 1 import lib from './lib' ~~~ diff --git a/e2e/__tests__/module-kinds/__snapshots__/es2015.test.ts.snap b/e2e/__tests__/module-kinds/__snapshots__/es2015.test.ts.snap index 5a7765531b..9bc6007ae7 100644 --- a/e2e/__tests__/module-kinds/__snapshots__/es2015.test.ts.snap +++ b/e2e/__tests__/module-kinds/__snapshots__/es2015.test.ts.snap @@ -6,13 +6,11 @@ exports[`run with options: {"module":"es2015","allowSyntheticDefaultImports":fal ===[ STDOUT ]=================================================================== ===[ STDERR ]=================================================================== - ts-jest[config] (WARN) TypeScript diagnostics (customize using \`[jest-config].globals.ts-jest.diagnostics\` option): - message TS151001: If you have issues related to imports, you should consider setting \`esModuleInterop\` to \`true\` in your TypeScript configuration file (usually \`tsconfig.json\`). See https://blogs.msdn.microsoft.com/typescript/2018/01/31/announcing-typescript-2-7/#easier-ecmascript-module-interoperability for more information. + ts-jest[config] (WARN) message TS151001: If you have issues related to imports, you should consider setting \`esModuleInterop\` to \`true\` in your TypeScript configuration file (usually \`tsconfig.json\`). See https://blogs.msdn.microsoft.com/typescript/2018/01/31/announcing-typescript-2-7/#easier-ecmascript-module-interoperability for more information. PASS ./ts-jest-tools.spec.ts PASS ./import-legacy.spec.ts PASS ./import-star.spec.ts - ts-jest[ts-compiler] (WARN) TypeScript diagnostics (customize using \`[jest-config].globals.ts-jest.diagnostics\` option): - import-default.spec.ts:1:8 - error TS1259: Module '"/lib"' can only be default-imported using the 'esModuleInterop' flag + ts-jest[ts-compiler] (WARN) import-default.spec.ts:1:8 - error TS1259: Module '"/lib"' can only be default-imported using the 'esModuleInterop' flag 1 import lib from './lib' ~~~ @@ -88,8 +86,7 @@ exports[`run with options: {"module":"es2015","esModuleInterop":false} 1`] = ` ===[ STDOUT ]=================================================================== ===[ STDERR ]=================================================================== - ts-jest[config] (WARN) TypeScript diagnostics (customize using \`[jest-config].globals.ts-jest.diagnostics\` option): - message TS151001: If you have issues related to imports, you should consider setting \`esModuleInterop\` to \`true\` in your TypeScript configuration file (usually \`tsconfig.json\`). See https://blogs.msdn.microsoft.com/typescript/2018/01/31/announcing-typescript-2-7/#easier-ecmascript-module-interoperability for more information. + ts-jest[config] (WARN) message TS151001: If you have issues related to imports, you should consider setting \`esModuleInterop\` to \`true\` in your TypeScript configuration file (usually \`tsconfig.json\`). See https://blogs.msdn.microsoft.com/typescript/2018/01/31/announcing-typescript-2-7/#easier-ecmascript-module-interoperability for more information. PASS ./ts-jest-tools.spec.ts PASS ./import-legacy.spec.ts PASS ./import-star.spec.ts @@ -127,8 +124,7 @@ exports[`run with options: {"module":"es2015","esModuleInterop":true} 1`] = ` ===[ STDERR ]=================================================================== PASS ./ts-jest-tools.spec.ts PASS ./import-legacy.spec.ts - ts-jest[ts-compiler] (WARN) TypeScript diagnostics (customize using \`[jest-config].globals.ts-jest.diagnostics\` option): - import-star.spec.ts:5:10 - error TS2349: This expression is not callable. + ts-jest[ts-compiler] (WARN) import-star.spec.ts:5:10 - error TS2349: This expression is not callable. Type 'typeof lib' has no call signatures. 5 expect(lib()).toBe('foo') @@ -172,8 +168,7 @@ exports[`run with options: {"module":"es2015"} 1`] = ` ===[ STDOUT ]=================================================================== ===[ STDERR ]=================================================================== - ts-jest[config] (WARN) TypeScript diagnostics (customize using \`[jest-config].globals.ts-jest.diagnostics\` option): - message TS151001: If you have issues related to imports, you should consider setting \`esModuleInterop\` to \`true\` in your TypeScript configuration file (usually \`tsconfig.json\`). See https://blogs.msdn.microsoft.com/typescript/2018/01/31/announcing-typescript-2-7/#easier-ecmascript-module-interoperability for more information. + ts-jest[config] (WARN) message TS151001: If you have issues related to imports, you should consider setting \`esModuleInterop\` to \`true\` in your TypeScript configuration file (usually \`tsconfig.json\`). See https://blogs.msdn.microsoft.com/typescript/2018/01/31/announcing-typescript-2-7/#easier-ecmascript-module-interoperability for more information. PASS ./ts-jest-tools.spec.ts PASS ./import-legacy.spec.ts PASS ./import-star.spec.ts diff --git a/e2e/__tests__/module-kinds/__snapshots__/esnext.test.ts.snap b/e2e/__tests__/module-kinds/__snapshots__/esnext.test.ts.snap index 8fe0d70025..16326746b2 100644 --- a/e2e/__tests__/module-kinds/__snapshots__/esnext.test.ts.snap +++ b/e2e/__tests__/module-kinds/__snapshots__/esnext.test.ts.snap @@ -6,13 +6,11 @@ exports[`run with options: {"module":"esnext","allowSyntheticDefaultImports":fal ===[ STDOUT ]=================================================================== ===[ STDERR ]=================================================================== - ts-jest[config] (WARN) TypeScript diagnostics (customize using \`[jest-config].globals.ts-jest.diagnostics\` option): - message TS151001: If you have issues related to imports, you should consider setting \`esModuleInterop\` to \`true\` in your TypeScript configuration file (usually \`tsconfig.json\`). See https://blogs.msdn.microsoft.com/typescript/2018/01/31/announcing-typescript-2-7/#easier-ecmascript-module-interoperability for more information. + ts-jest[config] (WARN) message TS151001: If you have issues related to imports, you should consider setting \`esModuleInterop\` to \`true\` in your TypeScript configuration file (usually \`tsconfig.json\`). See https://blogs.msdn.microsoft.com/typescript/2018/01/31/announcing-typescript-2-7/#easier-ecmascript-module-interoperability for more information. PASS ./ts-jest-tools.spec.ts PASS ./import-legacy.spec.ts PASS ./import-star.spec.ts - ts-jest[ts-compiler] (WARN) TypeScript diagnostics (customize using \`[jest-config].globals.ts-jest.diagnostics\` option): - import-default.spec.ts:1:8 - error TS1259: Module '"/lib"' can only be default-imported using the 'esModuleInterop' flag + ts-jest[ts-compiler] (WARN) import-default.spec.ts:1:8 - error TS1259: Module '"/lib"' can only be default-imported using the 'esModuleInterop' flag 1 import lib from './lib' ~~~ @@ -88,8 +86,7 @@ exports[`run with options: {"module":"esnext","esModuleInterop":false} 1`] = ` ===[ STDOUT ]=================================================================== ===[ STDERR ]=================================================================== - ts-jest[config] (WARN) TypeScript diagnostics (customize using \`[jest-config].globals.ts-jest.diagnostics\` option): - message TS151001: If you have issues related to imports, you should consider setting \`esModuleInterop\` to \`true\` in your TypeScript configuration file (usually \`tsconfig.json\`). See https://blogs.msdn.microsoft.com/typescript/2018/01/31/announcing-typescript-2-7/#easier-ecmascript-module-interoperability for more information. + ts-jest[config] (WARN) message TS151001: If you have issues related to imports, you should consider setting \`esModuleInterop\` to \`true\` in your TypeScript configuration file (usually \`tsconfig.json\`). See https://blogs.msdn.microsoft.com/typescript/2018/01/31/announcing-typescript-2-7/#easier-ecmascript-module-interoperability for more information. PASS ./ts-jest-tools.spec.ts PASS ./import-legacy.spec.ts PASS ./import-star.spec.ts @@ -127,8 +124,7 @@ exports[`run with options: {"module":"esnext","esModuleInterop":true} 1`] = ` ===[ STDERR ]=================================================================== PASS ./ts-jest-tools.spec.ts PASS ./import-legacy.spec.ts - ts-jest[ts-compiler] (WARN) TypeScript diagnostics (customize using \`[jest-config].globals.ts-jest.diagnostics\` option): - import-star.spec.ts:5:10 - error TS2349: This expression is not callable. + ts-jest[ts-compiler] (WARN) import-star.spec.ts:5:10 - error TS2349: This expression is not callable. Type 'typeof lib' has no call signatures. 5 expect(lib()).toBe('foo') @@ -172,8 +168,7 @@ exports[`run with options: {"module":"esnext"} 1`] = ` ===[ STDOUT ]=================================================================== ===[ STDERR ]=================================================================== - ts-jest[config] (WARN) TypeScript diagnostics (customize using \`[jest-config].globals.ts-jest.diagnostics\` option): - message TS151001: If you have issues related to imports, you should consider setting \`esModuleInterop\` to \`true\` in your TypeScript configuration file (usually \`tsconfig.json\`). See https://blogs.msdn.microsoft.com/typescript/2018/01/31/announcing-typescript-2-7/#easier-ecmascript-module-interoperability for more information. + ts-jest[config] (WARN) message TS151001: If you have issues related to imports, you should consider setting \`esModuleInterop\` to \`true\` in your TypeScript configuration file (usually \`tsconfig.json\`). See https://blogs.msdn.microsoft.com/typescript/2018/01/31/announcing-typescript-2-7/#easier-ecmascript-module-interoperability for more information. PASS ./ts-jest-tools.spec.ts PASS ./import-legacy.spec.ts PASS ./import-star.spec.ts diff --git a/e2e/__tests__/module-kinds/__snapshots__/none.test.ts.snap b/e2e/__tests__/module-kinds/__snapshots__/none.test.ts.snap index ea1348dddc..ea278574f3 100644 --- a/e2e/__tests__/module-kinds/__snapshots__/none.test.ts.snap +++ b/e2e/__tests__/module-kinds/__snapshots__/none.test.ts.snap @@ -6,13 +6,11 @@ exports[`run with options: {"module":"none","allowSyntheticDefaultImports":false ===[ STDOUT ]=================================================================== ===[ STDERR ]=================================================================== - ts-jest[config] (WARN) TypeScript diagnostics (customize using \`[jest-config].globals.ts-jest.diagnostics\` option): - message TS151001: If you have issues related to imports, you should consider setting \`esModuleInterop\` to \`true\` in your TypeScript configuration file (usually \`tsconfig.json\`). See https://blogs.msdn.microsoft.com/typescript/2018/01/31/announcing-typescript-2-7/#easier-ecmascript-module-interoperability for more information. + ts-jest[config] (WARN) message TS151001: If you have issues related to imports, you should consider setting \`esModuleInterop\` to \`true\` in your TypeScript configuration file (usually \`tsconfig.json\`). See https://blogs.msdn.microsoft.com/typescript/2018/01/31/announcing-typescript-2-7/#easier-ecmascript-module-interoperability for more information. PASS ./ts-jest-tools.spec.ts PASS ./import-legacy.spec.ts PASS ./import-star.spec.ts - ts-jest[ts-compiler] (WARN) TypeScript diagnostics (customize using \`[jest-config].globals.ts-jest.diagnostics\` option): - import-default.spec.ts:1:8 - error TS1259: Module '"/lib"' can only be default-imported using the 'esModuleInterop' flag + ts-jest[ts-compiler] (WARN) import-default.spec.ts:1:8 - error TS1259: Module '"/lib"' can only be default-imported using the 'esModuleInterop' flag 1 import lib from './lib' ~~~ @@ -88,8 +86,7 @@ exports[`run with options: {"module":"none","esModuleInterop":false} 1`] = ` ===[ STDOUT ]=================================================================== ===[ STDERR ]=================================================================== - ts-jest[config] (WARN) TypeScript diagnostics (customize using \`[jest-config].globals.ts-jest.diagnostics\` option): - message TS151001: If you have issues related to imports, you should consider setting \`esModuleInterop\` to \`true\` in your TypeScript configuration file (usually \`tsconfig.json\`). See https://blogs.msdn.microsoft.com/typescript/2018/01/31/announcing-typescript-2-7/#easier-ecmascript-module-interoperability for more information. + ts-jest[config] (WARN) message TS151001: If you have issues related to imports, you should consider setting \`esModuleInterop\` to \`true\` in your TypeScript configuration file (usually \`tsconfig.json\`). See https://blogs.msdn.microsoft.com/typescript/2018/01/31/announcing-typescript-2-7/#easier-ecmascript-module-interoperability for more information. PASS ./ts-jest-tools.spec.ts PASS ./import-legacy.spec.ts PASS ./import-star.spec.ts @@ -127,8 +124,7 @@ exports[`run with options: {"module":"none","esModuleInterop":true} 1`] = ` ===[ STDERR ]=================================================================== PASS ./ts-jest-tools.spec.ts PASS ./import-legacy.spec.ts - ts-jest[ts-compiler] (WARN) TypeScript diagnostics (customize using \`[jest-config].globals.ts-jest.diagnostics\` option): - import-star.spec.ts:5:10 - error TS2349: This expression is not callable. + ts-jest[ts-compiler] (WARN) import-star.spec.ts:5:10 - error TS2349: This expression is not callable. Type 'typeof lib' has no call signatures. 5 expect(lib()).toBe('foo') @@ -172,8 +168,7 @@ exports[`run with options: {"module":"none"} 1`] = ` ===[ STDOUT ]=================================================================== ===[ STDERR ]=================================================================== - ts-jest[config] (WARN) TypeScript diagnostics (customize using \`[jest-config].globals.ts-jest.diagnostics\` option): - message TS151001: If you have issues related to imports, you should consider setting \`esModuleInterop\` to \`true\` in your TypeScript configuration file (usually \`tsconfig.json\`). See https://blogs.msdn.microsoft.com/typescript/2018/01/31/announcing-typescript-2-7/#easier-ecmascript-module-interoperability for more information. + ts-jest[config] (WARN) message TS151001: If you have issues related to imports, you should consider setting \`esModuleInterop\` to \`true\` in your TypeScript configuration file (usually \`tsconfig.json\`). See https://blogs.msdn.microsoft.com/typescript/2018/01/31/announcing-typescript-2-7/#easier-ecmascript-module-interoperability for more information. PASS ./ts-jest-tools.spec.ts PASS ./import-legacy.spec.ts PASS ./import-star.spec.ts diff --git a/e2e/__tests__/module-kinds/__snapshots__/system.test.ts.snap b/e2e/__tests__/module-kinds/__snapshots__/system.test.ts.snap index 709b0381e0..acb9d8e6c7 100644 --- a/e2e/__tests__/module-kinds/__snapshots__/system.test.ts.snap +++ b/e2e/__tests__/module-kinds/__snapshots__/system.test.ts.snap @@ -6,13 +6,11 @@ exports[`run with options: {"module":"system","allowSyntheticDefaultImports":fal ===[ STDOUT ]=================================================================== ===[ STDERR ]=================================================================== - ts-jest[config] (WARN) TypeScript diagnostics (customize using \`[jest-config].globals.ts-jest.diagnostics\` option): - message TS151001: If you have issues related to imports, you should consider setting \`esModuleInterop\` to \`true\` in your TypeScript configuration file (usually \`tsconfig.json\`). See https://blogs.msdn.microsoft.com/typescript/2018/01/31/announcing-typescript-2-7/#easier-ecmascript-module-interoperability for more information. + ts-jest[config] (WARN) message TS151001: If you have issues related to imports, you should consider setting \`esModuleInterop\` to \`true\` in your TypeScript configuration file (usually \`tsconfig.json\`). See https://blogs.msdn.microsoft.com/typescript/2018/01/31/announcing-typescript-2-7/#easier-ecmascript-module-interoperability for more information. PASS ./ts-jest-tools.spec.ts PASS ./import-legacy.spec.ts PASS ./import-star.spec.ts - ts-jest[ts-compiler] (WARN) TypeScript diagnostics (customize using \`[jest-config].globals.ts-jest.diagnostics\` option): - import-default.spec.ts:1:8 - error TS1259: Module '"/lib"' can only be default-imported using the 'esModuleInterop' flag + ts-jest[ts-compiler] (WARN) import-default.spec.ts:1:8 - error TS1259: Module '"/lib"' can only be default-imported using the 'esModuleInterop' flag 1 import lib from './lib' ~~~ @@ -88,8 +86,7 @@ exports[`run with options: {"module":"system","esModuleInterop":false} 1`] = ` ===[ STDOUT ]=================================================================== ===[ STDERR ]=================================================================== - ts-jest[config] (WARN) TypeScript diagnostics (customize using \`[jest-config].globals.ts-jest.diagnostics\` option): - message TS151001: If you have issues related to imports, you should consider setting \`esModuleInterop\` to \`true\` in your TypeScript configuration file (usually \`tsconfig.json\`). See https://blogs.msdn.microsoft.com/typescript/2018/01/31/announcing-typescript-2-7/#easier-ecmascript-module-interoperability for more information. + ts-jest[config] (WARN) message TS151001: If you have issues related to imports, you should consider setting \`esModuleInterop\` to \`true\` in your TypeScript configuration file (usually \`tsconfig.json\`). See https://blogs.msdn.microsoft.com/typescript/2018/01/31/announcing-typescript-2-7/#easier-ecmascript-module-interoperability for more information. PASS ./ts-jest-tools.spec.ts PASS ./import-legacy.spec.ts PASS ./import-star.spec.ts @@ -127,8 +124,7 @@ exports[`run with options: {"module":"system","esModuleInterop":true} 1`] = ` ===[ STDERR ]=================================================================== PASS ./ts-jest-tools.spec.ts PASS ./import-legacy.spec.ts - ts-jest[ts-compiler] (WARN) TypeScript diagnostics (customize using \`[jest-config].globals.ts-jest.diagnostics\` option): - import-star.spec.ts:5:10 - error TS2349: This expression is not callable. + ts-jest[ts-compiler] (WARN) import-star.spec.ts:5:10 - error TS2349: This expression is not callable. Type 'typeof lib' has no call signatures. 5 expect(lib()).toBe('foo') @@ -172,8 +168,7 @@ exports[`run with options: {"module":"system"} 1`] = ` ===[ STDOUT ]=================================================================== ===[ STDERR ]=================================================================== - ts-jest[config] (WARN) TypeScript diagnostics (customize using \`[jest-config].globals.ts-jest.diagnostics\` option): - message TS151001: If you have issues related to imports, you should consider setting \`esModuleInterop\` to \`true\` in your TypeScript configuration file (usually \`tsconfig.json\`). See https://blogs.msdn.microsoft.com/typescript/2018/01/31/announcing-typescript-2-7/#easier-ecmascript-module-interoperability for more information. + ts-jest[config] (WARN) message TS151001: If you have issues related to imports, you should consider setting \`esModuleInterop\` to \`true\` in your TypeScript configuration file (usually \`tsconfig.json\`). See https://blogs.msdn.microsoft.com/typescript/2018/01/31/announcing-typescript-2-7/#easier-ecmascript-module-interoperability for more information. PASS ./ts-jest-tools.spec.ts PASS ./import-legacy.spec.ts PASS ./import-star.spec.ts diff --git a/e2e/__tests__/module-kinds/__snapshots__/umd.test.ts.snap b/e2e/__tests__/module-kinds/__snapshots__/umd.test.ts.snap index c984c58dbd..c443c37fb2 100644 --- a/e2e/__tests__/module-kinds/__snapshots__/umd.test.ts.snap +++ b/e2e/__tests__/module-kinds/__snapshots__/umd.test.ts.snap @@ -6,13 +6,11 @@ exports[`run with options: {"module":"umd","allowSyntheticDefaultImports":false} ===[ STDOUT ]=================================================================== ===[ STDERR ]=================================================================== - ts-jest[config] (WARN) TypeScript diagnostics (customize using \`[jest-config].globals.ts-jest.diagnostics\` option): - message TS151001: If you have issues related to imports, you should consider setting \`esModuleInterop\` to \`true\` in your TypeScript configuration file (usually \`tsconfig.json\`). See https://blogs.msdn.microsoft.com/typescript/2018/01/31/announcing-typescript-2-7/#easier-ecmascript-module-interoperability for more information. + ts-jest[config] (WARN) message TS151001: If you have issues related to imports, you should consider setting \`esModuleInterop\` to \`true\` in your TypeScript configuration file (usually \`tsconfig.json\`). See https://blogs.msdn.microsoft.com/typescript/2018/01/31/announcing-typescript-2-7/#easier-ecmascript-module-interoperability for more information. PASS ./ts-jest-tools.spec.ts PASS ./import-legacy.spec.ts PASS ./import-star.spec.ts - ts-jest[ts-compiler] (WARN) TypeScript diagnostics (customize using \`[jest-config].globals.ts-jest.diagnostics\` option): - import-default.spec.ts:1:8 - error TS1259: Module '"/lib"' can only be default-imported using the 'esModuleInterop' flag + ts-jest[ts-compiler] (WARN) import-default.spec.ts:1:8 - error TS1259: Module '"/lib"' can only be default-imported using the 'esModuleInterop' flag 1 import lib from './lib' ~~~ @@ -88,8 +86,7 @@ exports[`run with options: {"module":"umd","esModuleInterop":false} 1`] = ` ===[ STDOUT ]=================================================================== ===[ STDERR ]=================================================================== - ts-jest[config] (WARN) TypeScript diagnostics (customize using \`[jest-config].globals.ts-jest.diagnostics\` option): - message TS151001: If you have issues related to imports, you should consider setting \`esModuleInterop\` to \`true\` in your TypeScript configuration file (usually \`tsconfig.json\`). See https://blogs.msdn.microsoft.com/typescript/2018/01/31/announcing-typescript-2-7/#easier-ecmascript-module-interoperability for more information. + ts-jest[config] (WARN) message TS151001: If you have issues related to imports, you should consider setting \`esModuleInterop\` to \`true\` in your TypeScript configuration file (usually \`tsconfig.json\`). See https://blogs.msdn.microsoft.com/typescript/2018/01/31/announcing-typescript-2-7/#easier-ecmascript-module-interoperability for more information. PASS ./ts-jest-tools.spec.ts PASS ./import-legacy.spec.ts PASS ./import-star.spec.ts @@ -127,8 +124,7 @@ exports[`run with options: {"module":"umd","esModuleInterop":true} 1`] = ` ===[ STDERR ]=================================================================== PASS ./ts-jest-tools.spec.ts PASS ./import-legacy.spec.ts - ts-jest[ts-compiler] (WARN) TypeScript diagnostics (customize using \`[jest-config].globals.ts-jest.diagnostics\` option): - import-star.spec.ts:5:10 - error TS2349: This expression is not callable. + ts-jest[ts-compiler] (WARN) import-star.spec.ts:5:10 - error TS2349: This expression is not callable. Type 'typeof lib' has no call signatures. 5 expect(lib()).toBe('foo') @@ -172,8 +168,7 @@ exports[`run with options: {"module":"umd"} 1`] = ` ===[ STDOUT ]=================================================================== ===[ STDERR ]=================================================================== - ts-jest[config] (WARN) TypeScript diagnostics (customize using \`[jest-config].globals.ts-jest.diagnostics\` option): - message TS151001: If you have issues related to imports, you should consider setting \`esModuleInterop\` to \`true\` in your TypeScript configuration file (usually \`tsconfig.json\`). See https://blogs.msdn.microsoft.com/typescript/2018/01/31/announcing-typescript-2-7/#easier-ecmascript-module-interoperability for more information. + ts-jest[config] (WARN) message TS151001: If you have issues related to imports, you should consider setting \`esModuleInterop\` to \`true\` in your TypeScript configuration file (usually \`tsconfig.json\`). See https://blogs.msdn.microsoft.com/typescript/2018/01/31/announcing-typescript-2-7/#easier-ecmascript-module-interoperability for more information. PASS ./ts-jest-tools.spec.ts PASS ./import-legacy.spec.ts PASS ./import-star.spec.ts diff --git a/src/compiler/__snapshots__/language-service.spec.ts.snap b/src/compiler/__snapshots__/language-service.spec.ts.snap index cf43a288db..0d1f547a12 100644 --- a/src/compiler/__snapshots__/language-service.spec.ts.snap +++ b/src/compiler/__snapshots__/language-service.spec.ts.snap @@ -66,10 +66,7 @@ exports[`language service should compile tsx file for other jsx options 1`] = ` ================================================================================ `; -exports[`language service should report diagnostics related to typings with pathRegex config matches file name 1`] = ` -"TypeScript diagnostics (customize using \`[jest-config].globals.ts-jest.diagnostics\` option): -test-match-regex-diagnostics.ts(3,7): error TS2322: Type 'number' is not assignable to type 'string'." -`; +exports[`language service should report diagnostics related to typings with pathRegex config matches file name 1`] = `"test-match-regex-diagnostics.ts(3,7): error TS2322: Type 'number' is not assignable to type 'string'."`; exports[`language service should throw error when cannot compile 1`] = ` "Unable to require \`.d.ts\` file for file: test-cannot-compile.d.ts. diff --git a/src/compiler/__snapshots__/program.spec.ts.snap b/src/compiler/__snapshots__/program.spec.ts.snap index c47d8cf779..30ee6b0fef 100644 --- a/src/compiler/__snapshots__/program.spec.ts.snap +++ b/src/compiler/__snapshots__/program.spec.ts.snap @@ -146,9 +146,10 @@ exports[`other jsx options should compile tsx file for with program 1`] = ` ================================================================================ `; +exports[`typings incremental program should not report diagnostics with pathRegex config does not match file name 1`] = `"test-typings.ts: Emit skipped"`; + exports[`typings incremental program should report diagnostics with pathRegex config matches file name 1`] = `"test-typings.ts: Emit skipped"`; -exports[`typings normal program should report diagnostics with pathRegex config matches file name 1`] = ` -"TypeScript diagnostics (customize using \`[jest-config].globals.ts-jest.diagnostics\` option): -test-typings.ts(3,7): error TS2322: Type 'number' is not assignable to type 'string'." -`; +exports[`typings normal program should not report diagnostics with pathRegex config matches file name 1`] = `"test-typings.ts: Emit skipped"`; + +exports[`typings normal program should report diagnostics with pathRegex config matches file name 1`] = `"test-typings.ts(3,7): error TS2322: Type 'number' is not assignable to type 'string'."`; diff --git a/src/compiler/__snapshots__/transpile-module.spec.ts.snap b/src/compiler/__snapshots__/transpile-module.spec.ts.snap index 5900da9ae3..0b2561b610 100644 --- a/src/compiler/__snapshots__/transpile-module.spec.ts.snap +++ b/src/compiler/__snapshots__/transpile-module.spec.ts.snap @@ -84,12 +84,6 @@ exports[`transpile module with isolatedModule: true should compile using transpi ================================================================================ `; -exports[`transpile module with isolatedModule: true should report diagnostics related to codes with pathRegex config is undefined 1`] = ` -"TypeScript diagnostics (customize using \`[jest-config].globals.ts-jest.diagnostics\` option): -foo.ts(2,23): error TS1005: '=>' expected." -`; +exports[`transpile module with isolatedModule: true should report diagnostics related to codes with pathRegex config is undefined 1`] = `"foo.ts(2,23): error TS1005: '=>' expected."`; -exports[`transpile module with isolatedModule: true should report diagnostics related to codes with pathRegex config matches file name 1`] = ` -"TypeScript diagnostics (customize using \`[jest-config].globals.ts-jest.diagnostics\` option): -foo.ts(2,23): error TS1005: '=>' expected." -`; +exports[`transpile module with isolatedModule: true should report diagnostics related to codes with pathRegex config matches file name 1`] = `"foo.ts(2,23): error TS1005: '=>' expected."`; diff --git a/src/compiler/program.spec.ts b/src/compiler/program.spec.ts index cfbc49fb10..6a658de2aa 100644 --- a/src/compiler/program.spec.ts +++ b/src/compiler/program.spec.ts @@ -50,11 +50,7 @@ const t: string = f(5) }, }) - try { - compiler.compile(source, fileName) - } catch (e) { - expect(e).not.toContain('TypeScript diagnostics') - } + expect(() => compiler.compile(source, fileName)).toThrowErrorMatchingSnapshot() }) }) @@ -80,11 +76,7 @@ const t: string = f(5) }, }) - try { - compiler.compile(source, fileName) - } catch (e) { - expect(e).not.toContain('TypeScript diagnostics') - } + expect(() => compiler.compile(source, fileName)).toThrowErrorMatchingSnapshot() }) }) }) diff --git a/src/config/config-set.spec.ts b/src/config/config-set.spec.ts index 67c05ae70c..fa7593768a 100644 --- a/src/config/config-set.spec.ts +++ b/src/config/config-set.spec.ts @@ -523,8 +523,7 @@ describe('typescript', () => { esModuleInterop: false, }) expect(target.lines.warn.join()).toMatchInlineSnapshot(` -"[level:40] TypeScript diagnostics (customize using \`[jest-config].globals.ts-jest.diagnostics\` option): -message TS151001: If you have issues related to imports, you should consider setting \`esModuleInterop\` to \`true\` in your TypeScript configuration file (usually \`tsconfig.json\`). See https://blogs.msdn.microsoft.com/typescript/2018/01/31/announcing-typescript-2-7/#easier-ecmascript-module-interoperability for more information. +"[level:40] message TS151001: If you have issues related to imports, you should consider setting \`esModuleInterop\` to \`true\` in your TypeScript configuration file (usually \`tsconfig.json\`). See https://blogs.msdn.microsoft.com/typescript/2018/01/31/announcing-typescript-2-7/#easier-ecmascript-module-interoperability for more information. " `) }) diff --git a/src/util/messages.ts b/src/util/messages.ts index eb83167f38..6bd9d2f2c9 100644 --- a/src/util/messages.ts +++ b/src/util/messages.ts @@ -11,7 +11,7 @@ export const enum Errors { FileNotFound = 'File not found: {{inputPath}} (resolved as: {{resolvedPath}})', UntestedDependencyVersion = "Version {{actualVersion}} of {{module}} installed has not been tested with ts-jest. If you're experiencing issues, consider using a supported version ({{expectedVersion}}). Please do not report issues in ts-jest if you are using unsupported versions.", MissingDependency = "Module {{module}} is not installed. If you're experiencing issues, consider installing a supported version ({{expectedVersion}}).", - UnableToCompileTypeScript = 'TypeScript diagnostics ({{help}}):\n{{diagnostics}}', + UnableToCompileTypeScript = '{{diagnostics}}', NotMappingMultiStarPath = 'Not mapping "{{path}}" because it has more than one star (`*`).', NotMappingPathWithEmptyMap = 'Not mapping "{{path}}" because it has no target.', MappingOnlyFirstTargetOfPath = 'Mapping only to first target of "{{path}}" because it has more than one ({{count}}).', @@ -27,7 +27,6 @@ export const enum Errors { */ export const enum Helps { FixMissingModule = '{{label}}: `npm i -D {{module}}` (or `yarn add --dev {{module}}`)', - IgnoreDiagnosticCode = 'customize using `[jest-config].globals.ts-jest.diagnostics` option', MigrateConfigUsingCLI = 'Your Jest configuration is outdated. Use the CLI to help migrating it: ts-jest config:migrate .', } diff --git a/src/util/ts-error.ts b/src/util/ts-error.ts index 6c25a3bae2..241d348d41 100644 --- a/src/util/ts-error.ts +++ b/src/util/ts-error.ts @@ -2,7 +2,7 @@ import { BaseError } from 'make-error' import { inspect } from 'util' import { rootLogger } from './logger' -import { Errors, Helps, interpolate } from './messages' +import { Errors, interpolate } from './messages' const logger = rootLogger.child({ namespace: 'TSError' }) @@ -22,7 +22,6 @@ export class TSError extends BaseError { super( interpolate(Errors.UnableToCompileTypeScript, { diagnostics: diagnosticText.trim(), - help: Helps.IgnoreDiagnosticCode, }), ) logger.debug({ diagnosticCodes, diagnosticText }, 'created new TSError')