Skip to content

Commit 6b95db9

Browse files
authored
Merge branch 'master' into remove-packageJson
2 parents 1a425df + 5bbfd06 commit 6b95db9

20 files changed

Lines changed: 583 additions & 837 deletions

File tree

docs/user/config/index.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ module.exports = {
186186
To utilize IDE suggestions, you can use `JSDoc` comments to provide suggested `ts-jest` configs for your Jest config:
187187

188188
```js
189-
/** @typedef {import('ts-jest')} */
189+
/** @typedef {import('ts-jest/dist/types')} */
190190
/** @type {import('@jest/types').Config.InitialOptions} */
191191
const config = {
192192
// [...]
@@ -207,7 +207,7 @@ All options have default values which should fit most of the projects. Click on
207207
| Option | Description | Type | Default |
208208
|---|---|---|---|
209209
| [**`compiler`**][compiler] | [TypeScript module to use as compiler.][compiler] | `string` | `"typescript"` |
210-
| [**`tsConfig` or `tsconfig`**][tsConfig] | [TypeScript compiler related configuration.][tsConfig] | `string`\|`object`\|`boolean` | _auto_ |
210+
| [**`tsconfig`**][tsconfig] | [TypeScript compiler related configuration.][tsconfig] | `string`\|`object`\|`boolean` | _auto_ |
211211
| [**`isolatedModules`**][isolatedModules] | [Disable type-checking][isolatedModules] | `boolean` | _disabled_ |
212212
| [**`astTransformers`**][astTransformers] | [Custom TypeScript AST transformers][astTransformers] | `object` | _auto_ |
213213
| [**`diagnostics`**][diagnostics] | [Diagnostics related configuration.][diagnostics] | `boolean`\|`object` | _enabled_ |
@@ -259,7 +259,7 @@ npx ts-jest config:migrate package.json
259259
</div></div>
260260

261261
[compiler]: compiler
262-
[tsConfig]: tsConfig
262+
[tsconfig]: tsconfig
263263
[isolatedModules]: isolatedModules
264264
[astTransformers]: astTransformers
265265
[compilerHost]: compilerHost
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ module.exports = {
3737
"jest": {
3838
"globals": {
3939
"ts-jest": {
40-
"tsConfig": "tsconfig.test.json"
40+
"tsconfig": "tsconfig.test.json"
4141
}
4242
}
4343
}
@@ -76,7 +76,7 @@ module.exports = {
7676
"jest": {
7777
"globals": {
7878
"ts-jest": {
79-
"tsConfig": {
79+
"tsconfig": {
8080
"importHelpers": true
8181
}
8282
}
@@ -114,7 +114,7 @@ module.exports = {
114114
"jest": {
115115
"globals": {
116116
"ts-jest": {
117-
"tsConfig": false
117+
"tsconfig": false
118118
}
119119
}
120120
}

e2e/__cases__/test-helpers/deprecated.spec.ts

Lines changed: 0 additions & 9 deletions
This file was deleted.

e2e/__tests__/__snapshots__/logger.test.ts.snap

Lines changed: 0 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ Array [
55
"[level:20] creating jest presets not handling JavaScript files",
66
"[level:20] creating jest presets not handling JavaScript files",
77
"[level:20] creating Importer singleton",
8-
"[level:20] checking version of jest: OK",
98
"[level:20] created new transformer",
109
"[level:30] no matching config-set found, creating a new one",
1110
"[level:20] loaded module typescript",
@@ -44,7 +43,6 @@ Array [
4443
"[level:20] creating jest presets not handling JavaScript files",
4544
"[level:20] creating jest presets not handling JavaScript files",
4645
"[level:20] creating Importer singleton",
47-
"[level:20] checking version of jest: OK",
4846
"[level:20] created new transformer",
4947
"[level:30] no matching config-set found, creating a new one",
5048
"[level:20] loaded module typescript",
@@ -89,7 +87,6 @@ Array [
8987
"[level:20] creating jest presets not handling JavaScript files",
9088
"[level:20] creating jest presets not handling JavaScript files",
9189
"[level:20] creating Importer singleton",
92-
"[level:20] checking version of jest: OK",
9390
"[level:20] created new transformer",
9491
"[level:30] no matching config-set found, creating a new one",
9592
"[level:20] loaded module typescript",
@@ -187,63 +184,6 @@ exports[`ts-jest logging deprecation warning with astTransformers config as stri
187184
================================================================================
188185
`;
189186
190-
exports[`ts-jest logging deprecation warning with tsConfig config should pass using template "default" 1`] = `
191-
√ jest
192-
↳ exit code: 0
193-
===[ STDOUT ]===================================================================
194-
195-
===[ STDERR ]===================================================================
196-
ts-jest[config] (WARN) The option \`tsConfig\` is deprecated and will be removed in ts-jest 27, use \`tsconfig\` instead
197-
PASS ./Hello.spec.ts
198-
Hello Class
199-
√ should create a new Hello
200-
201-
Test Suites: 1 passed, 1 total
202-
Tests: 1 passed, 1 total
203-
Snapshots: 0 total
204-
Time: XXs
205-
Ran all test suites.
206-
================================================================================
207-
`;
208-
209-
exports[`ts-jest logging deprecation warning with tsConfig config should pass using template "with-babel-7" 1`] = `
210-
√ jest
211-
↳ exit code: 0
212-
===[ STDOUT ]===================================================================
213-
214-
===[ STDERR ]===================================================================
215-
ts-jest[config] (WARN) The option \`tsConfig\` is deprecated and will be removed in ts-jest 27, use \`tsconfig\` instead
216-
PASS ./Hello.spec.ts
217-
Hello Class
218-
√ should create a new Hello
219-
220-
Test Suites: 1 passed, 1 total
221-
Tests: 1 passed, 1 total
222-
Snapshots: 0 total
223-
Time: XXs
224-
Ran all test suites.
225-
================================================================================
226-
`;
227-
228-
exports[`ts-jest logging deprecation warning with tsConfig config should pass using template "with-babel-7-string-config" 1`] = `
229-
√ jest
230-
↳ exit code: 0
231-
===[ STDOUT ]===================================================================
232-
233-
===[ STDERR ]===================================================================
234-
ts-jest[config] (WARN) The option \`tsConfig\` is deprecated and will be removed in ts-jest 27, use \`tsconfig\` instead
235-
PASS ./Hello.spec.ts
236-
Hello Class
237-
√ should create a new Hello
238-
239-
Test Suites: 1 passed, 1 total
240-
Tests: 1 passed, 1 total
241-
Snapshots: 0 total
242-
Time: XXs
243-
Ran all test suites.
244-
================================================================================
245-
`;
246-
247187
exports[`ts-jest logging with unsupported version test with TS_JEST_DISABLE_VER_CHECKER is not set in process.env should pass using template "with-unsupported-version" 1`] = `
248188
√ jest
249189
↳ exit code: 0

e2e/__tests__/__snapshots__/test-helpers.test.ts.snap

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,8 @@ exports[`test-helpers 1`] = `
1919
9 expect(mocked(bar, true).dummy.deep.deeper(42)).toBeUndefined()
2020
~~
2121
22-
ts-jest[root] (WARN) The \`mocked\` helper has been moved to \`ts-jest/utils\`. Use \`import { mocked } from 'ts-jest/utils'\` instead.
23-
PASS ./deprecated.spec.ts
24-
25-
Test Suites: 1 failed, 2 passed, 3 total
26-
Tests: 4 passed, 4 total
22+
Test Suites: 1 failed, 1 passed, 2 total
23+
Tests: 3 passed, 3 total
2724
Snapshots: 0 total
2825
Time: XXs
2926
Ran all test suites.
@@ -49,11 +46,8 @@ exports[`with esModuleInterop set to false 1`] = `
4946
9 expect(mocked(bar, true).dummy.deep.deeper(42)).toBeUndefined()
5047
~~
5148
52-
ts-jest[root] (WARN) The \`mocked\` helper has been moved to \`ts-jest/utils\`. Use \`import { mocked } from 'ts-jest/utils'\` instead.
53-
PASS ./deprecated.spec.ts
54-
55-
Test Suites: 1 failed, 2 passed, 3 total
56-
Tests: 4 passed, 4 total
49+
Test Suites: 1 failed, 1 passed, 2 total
50+
Tests: 3 passed, 3 total
5751
Snapshots: 0 total
5852
Time: XXs
5953
Ran all test suites.

e2e/__tests__/logger.test.ts

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -107,21 +107,5 @@ describe('ts-jest logging', () => {
107107
})
108108
})
109109
})
110-
111-
describe('with tsConfig config', () => {
112-
const testCase = configureTestCase('simple', {
113-
tsJestConfig: {
114-
tsConfig: true,
115-
}
116-
})
117-
118-
testCase.runWithTemplates(allPackageSetsWithPreset, 0, (runTest, { testLabel }) => {
119-
it(testLabel, () => {
120-
const result = runTest()
121-
expect(result.status).toBe(0)
122-
expect(result).toMatchSnapshot()
123-
})
124-
})
125-
})
126110
})
127111
})

src/__helpers__/fakers.ts

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { resolve } from 'path'
44

55
import { createCompilerInstance } from '../compiler/instance'
66
import { ConfigSet } from '../config/config-set'
7-
import type { BabelConfig, TsCompiler, TsJestConfig, TsJestGlobalOptions } from '../types'
7+
import type { BabelConfig, TsCompiler, TsJestGlobalOptions } from '../types'
88
import type { ImportReasons } from '../utils/messages'
99

1010
export function filePath(relPath: string): string {
@@ -13,19 +13,6 @@ export function filePath(relPath: string): string {
1313

1414
export const rootDir = filePath('')
1515

16-
export function tsJestConfig(options?: Partial<TsJestConfig>): TsJestConfig {
17-
return {
18-
isolatedModules: false,
19-
compiler: 'typescript',
20-
transformers: options?.transformers ?? Object.create(null),
21-
babelConfig: undefined,
22-
tsConfig: undefined,
23-
stringifyContentPathRegex: undefined,
24-
diagnostics: { ignoreCodes: [], pretty: false, throws: true },
25-
...options,
26-
}
27-
}
28-
2916
function getJestConfig<T extends Config.ProjectConfig>(
3017
options?: Partial<Config.InitialOptions | Config.ProjectConfig>,
3118
tsJestOptions?: TsJestGlobalOptions,
File renamed without changes.

0 commit comments

Comments
 (0)