Skip to content

Commit

Permalink
fix: handle tsBuildInfoFile option
Browse files Browse the repository at this point in the history
Fixes #1095
  • Loading branch information
haines committed Sep 1, 2019
1 parent 7ac9f42 commit f9583e9
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 8 deletions.
3 changes: 3 additions & 0 deletions e2e/__cases__/composite/foo.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
test('foo', () => {
expect(true).toBeTruthy();
});
6 changes: 6 additions & 0 deletions e2e/__cases__/composite/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"compilerOptions": {
"composite": true,
"tsBuildInfoFile": ".tsbuildinfo"
}
}
6 changes: 3 additions & 3 deletions e2e/__templates__/default/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion e2e/__templates__/default/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"@types/jest": "24.0.6",
"@types/node": "10.12.5",
"jest": "24.9.0",
"typescript": "3.1.6"
"typescript": "3.4.5"
},
"wantedDependencies": {
"@types/jest": "latest",
Expand Down
8 changes: 4 additions & 4 deletions e2e/__tests__/__snapshots__/test-helpers.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ exports[`test-helpers 1`] = `
● Test suite failed to run
TypeScript diagnostics (customize using \`[jest-config].globals.ts-jest.diagnostics\` option):
fail.spec.ts:7:10 - error TS2554: Expected 0 arguments, but got 1.
fail.spec.ts:7:22 - error TS2554: Expected 0 arguments, but got 1.
7 expect(mocked(foo)('hello')).toBeUndefined()
~~~~~~~~~~~~~~~~~~~~
~~~~~~~
fail.spec.ts:9:46 - error TS2345: Argument of type '42' is not assignable to parameter of type 'string'.
9 expect(mocked(bar, true).dummy.deep.deeper(42)).toBeUndefined()
Expand Down Expand Up @@ -42,10 +42,10 @@ exports[`with esModuleInterop set to false 1`] = `
● Test suite failed to run
TypeScript diagnostics (customize using \`[jest-config].globals.ts-jest.diagnostics\` option):
fail.spec.ts:7:10 - error TS2554: Expected 0 arguments, but got 1.
fail.spec.ts:7:22 - error TS2554: Expected 0 arguments, but got 1.
7 expect(mocked(foo)('hello')).toBeUndefined()
~~~~~~~~~~~~~~~~~~~~
~~~~~~~
fail.spec.ts:9:46 - error TS2345: Argument of type '42' is not assignable to parameter of type 'string'.
9 expect(mocked(bar, true).dummy.deep.deeper(42)).toBeUndefined()
Expand Down
13 changes: 13 additions & 0 deletions e2e/__tests__/composite.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { PackageSets } from '../__helpers__/templates'
import { configureTestCase } from '../__helpers__/test-case'

describe('with composite enabled', () => {
const testCase = configureTestCase('composite')

testCase.runWithTemplates([PackageSets.default], 0, (runTest, { testLabel }) => {
it(testLabel, () => {
const result = runTest()
expect(result.status).toBe(0)
})
})
})
2 changes: 2 additions & 0 deletions src/config/config-set.ts
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,9 @@ export class ConfigSet {
declarationDir: undefined,
declarationMap: undefined,
emitDeclarationOnly: undefined,
incremental: undefined,
sourceRoot: undefined,
tsBuildInfoFile: undefined,
}
// force the module kind if not piping babel-jest
if (!this.tsJest.babelConfig) {
Expand Down

0 comments on commit f9583e9

Please sign in to comment.