Skip to content

Commit

Permalink
feat(config): typeCheck default to true (langauge service)
Browse files Browse the repository at this point in the history
Renames `typeCheck` to `isolatedModules`. Default value (`false`) did
not change, but that actually means the opposite

BREAKING CHANGE: Language service will be used by default from now on
  • Loading branch information
huafu committed Sep 2, 2018
1 parent de5c967 commit 623b2f4
Show file tree
Hide file tree
Showing 38 changed files with 1,159 additions and 87 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
- [Logging](#logging)
- [Known Limitations](#known-limitations)
- [Known limitations for TS compiler options](#known-limitations-for-ts-compiler-options)
- [`const enum` is not supported if `typeCheck` is not enabled](#const-enum-is-not-supported-if-typecheck-is-not-enabled)
- [`const enum` is not supported if `isolatedModules` is enabled](#const-enum-is-not-supported-if-isolatedmodules-is-enabled)
- [How to Contribute](#how-to-contribute)
- [Quickstart to run tests (only if you're working on this package)](#quickstart-to-run-tests-only-if-youre-working-on-this-package)
- [License](#license)
Expand Down Expand Up @@ -405,7 +405,7 @@ If you use `"baseUrl": "<path_to_your_sources>"`, you also have to change `jest
}
```

### `const enum` is not supported if `typeCheck` is not enabled
### `const enum` is not supported if `isolatedModules` is enabled

This is due to a limitation in the ts-jest basic processor which compiles each test file individually, therefore ignoring implementations of ambient declarations. The TypeScript team currently have [no plan to support const enum inlining](https://github.com/Microsoft/TypeScript/issues/5243) for this particular compiler method. See [#112](https://github.com/kulshekhar/ts-jest/issues/112) and [#281](https://github.com/kulshekhar/ts-jest/issues/281) for more information.

Expand Down
2 changes: 1 addition & 1 deletion e2e/__helpers__/test-case/run-result.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export default class RunResult {
try {
io = require(`${this.context.ioDir}/${relFilePath}.json`)
} catch (err) {
io.out = `/* ts-jest after hook has not been called! ${err} */`
io.out = `/*\nts-jest after hook has not been called!\n${err}\noutput:\n${this.output}*/`
}
return new ProcessedFileIo(this.cwd, relFilePath, io.in, io.out)
}
Expand Down
14 changes: 10 additions & 4 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: 2 additions & 0 deletions e2e/__templates__/default/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@
"private": true,
"devDependencies": {
"@types/jest": "23.3.1",
"@types/node": "10.9.4",
"jest": "23.5.0",
"typescript": "3.0.3"
},
"wantedDependencies": {
"@types/jest": "latest",
"@types/node": "latest",
"jest": "latest",
"typescript": "latest"
}
Expand Down
7 changes: 7 additions & 0 deletions e2e/__templates__/default/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"compilerOptions": {
"types": [
"jest", "node"
]
}
}
14 changes: 10 additions & 4 deletions e2e/__templates__/with-babel-6/package-lock.json

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

2 changes: 2 additions & 0 deletions e2e/__templates__/with-babel-6/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@
"private": true,
"devDependencies": {
"@types/jest": "23.3.1",
"@types/node": "10.9.4",
"babel-core": "6.26.3",
"jest": "23.5.0",
"typescript": "3.0.3"
},
"wantedDependencies": {
"@types/jest": "latest",
"@types/node": "latest",
"babel-core": "6",
"jest": "latest",
"typescript": "latest"
Expand Down
7 changes: 7 additions & 0 deletions e2e/__templates__/with-babel-6/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"compilerOptions": {
"types": [
"jest", "node"
]
}
}
14 changes: 10 additions & 4 deletions e2e/__templates__/with-babel-7/package-lock.json

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

2 changes: 2 additions & 0 deletions e2e/__templates__/with-babel-7/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@
"devDependencies": {
"@babel/core": "7.0.0",
"@types/jest": "23.3.1",
"@types/node": "10.9.4",
"babel-core": "7.0.0-bridge.0",
"jest": "23.5.0",
"typescript": "3.0.3"
},
"wantedDependencies": {
"@babel/core": "7",
"@types/jest": "latest",
"@types/node": "latest",
"babel-core": "7.0.0-bridge.0",
"jest": "latest",
"typescript": "latest"
Expand Down
7 changes: 7 additions & 0 deletions e2e/__templates__/with-babel-7/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"compilerOptions": {
"types": [
"jest", "node"
]
}
}
14 changes: 10 additions & 4 deletions e2e/__templates__/with-jest-22/package-lock.json

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

2 changes: 2 additions & 0 deletions e2e/__templates__/with-jest-22/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@
"private": true,
"devDependencies": {
"@types/jest": "22.2.3",
"@types/node": "10.9.4",
"jest": "22.4.4",
"typescript": "3.0.3"
},
"wantedDependencies": {
"@types/jest": "22",
"@types/node": "latest",
"jest": "22",
"typescript": "latest"
}
Expand Down
7 changes: 7 additions & 0 deletions e2e/__templates__/with-jest-22/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"compilerOptions": {
"types": [
"jest", "node"
]
}
}
14 changes: 10 additions & 4 deletions e2e/__templates__/with-typescript-2-7/package-lock.json

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

2 changes: 2 additions & 0 deletions e2e/__templates__/with-typescript-2-7/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@
"private": true,
"devDependencies": {
"@types/jest": "23.3.1",
"@types/node": "10.9.4",
"jest": "23.5.0",
"typescript": "2.7.2"
},
"wantedDependencies": {
"@types/jest": "latest",
"@types/node": "latest",
"jest": "latest",
"typescript": "2.7"
}
Expand Down
7 changes: 7 additions & 0 deletions e2e/__templates__/with-typescript-2-7/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"compilerOptions": {
"types": [
"jest", "node"
]
}
}
14 changes: 10 additions & 4 deletions e2e/__templates__/with-unsupported-version/package-lock.json

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

2 changes: 2 additions & 0 deletions e2e/__templates__/with-unsupported-version/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@
"private": true,
"devDependencies": {
"@types/jest": "23.3.1",
"@types/node": "10.9.4",
"jest": "23.5.0",
"typescript": "2.5.3"
},
"wantedDependencies": {
"@types/jest": "latest",
"@types/node": "latest",
"jest": "latest",
"typescript": "2.5"
}
Expand Down
7 changes: 7 additions & 0 deletions e2e/__templates__/with-unsupported-version/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"compilerOptions": {
"types": [
"jest", "node"
]
}
}
Loading

0 comments on commit 623b2f4

Please sign in to comment.