Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(config): remove support for tsConfig option #2127

Merged
merged 1 commit into from Nov 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/user/config/index.md
Expand Up @@ -207,7 +207,7 @@ All options have default values which should fit most of the projects. Click on
| Option | Description | Type | Default |
|---|---|---|---|
| [**`compiler`**][compiler] | [TypeScript module to use as compiler.][compiler] | `string` | `"typescript"` |
| [**`tsConfig` or `tsconfig`**][tsConfig] | [TypeScript compiler related configuration.][tsConfig] | `string`\|`object`\|`boolean` | _auto_ |
| [**`tsconfig`**][tsconfig] | [TypeScript compiler related configuration.][tsconfig] | `string`\|`object`\|`boolean` | _auto_ |
| [**`isolatedModules`**][isolatedModules] | [Disable type-checking][isolatedModules] | `boolean` | _disabled_ |
| [**`astTransformers`**][astTransformers] | [Custom TypeScript AST transformers][astTransformers] | `object` | _auto_ |
| [**`diagnostics`**][diagnostics] | [Diagnostics related configuration.][diagnostics] | `boolean`\|`object` | _enabled_ |
Expand Down Expand Up @@ -260,7 +260,7 @@ npx ts-jest config:migrate package.json
</div></div>

[compiler]: compiler
[tsConfig]: tsConfig
[tsconfig]: tsconfig
[isolatedModules]: isolatedModules
[astTransformers]: astTransformers
[compilerHost]: compilerHost
Expand Down
6 changes: 3 additions & 3 deletions docs/user/config/tsConfig.md → docs/user/config/tsconfig.md
Expand Up @@ -37,7 +37,7 @@ module.exports = {
"jest": {
"globals": {
"ts-jest": {
"tsConfig": "tsconfig.test.json"
"tsconfig": "tsconfig.test.json"
}
}
}
Expand Down Expand Up @@ -76,7 +76,7 @@ module.exports = {
"jest": {
"globals": {
"ts-jest": {
"tsConfig": {
"tsconfig": {
"importHelpers": true
}
}
Expand Down Expand Up @@ -114,7 +114,7 @@ module.exports = {
"jest": {
"globals": {
"ts-jest": {
"tsConfig": false
"tsconfig": false
}
}
}
Expand Down
57 changes: 0 additions & 57 deletions e2e/__tests__/__snapshots__/logger.test.ts.snap
Expand Up @@ -244,63 +244,6 @@ exports[`ts-jest logging deprecation warning with packageJson config should pass
================================================================================
`;

exports[`ts-jest logging deprecation warning with tsConfig config should pass using template "default" 1`] = `
√ jest
↳ exit code: 0
===[ STDOUT ]===================================================================

===[ STDERR ]===================================================================
ts-jest[config] (WARN) The option \`tsConfig\` is deprecated and will be removed in ts-jest 27, use \`tsconfig\` instead
PASS ./Hello.spec.ts
Hello Class
√ should create a new Hello

Test Suites: 1 passed, 1 total
Tests: 1 passed, 1 total
Snapshots: 0 total
Time: XXs
Ran all test suites.
================================================================================
`;

exports[`ts-jest logging deprecation warning with tsConfig config should pass using template "with-babel-7" 1`] = `
√ jest
↳ exit code: 0
===[ STDOUT ]===================================================================

===[ STDERR ]===================================================================
ts-jest[config] (WARN) The option \`tsConfig\` is deprecated and will be removed in ts-jest 27, use \`tsconfig\` instead
PASS ./Hello.spec.ts
Hello Class
√ should create a new Hello

Test Suites: 1 passed, 1 total
Tests: 1 passed, 1 total
Snapshots: 0 total
Time: XXs
Ran all test suites.
================================================================================
`;

exports[`ts-jest logging deprecation warning with tsConfig config should pass using template "with-babel-7-string-config" 1`] = `
√ jest
↳ exit code: 0
===[ STDOUT ]===================================================================

===[ STDERR ]===================================================================
ts-jest[config] (WARN) The option \`tsConfig\` is deprecated and will be removed in ts-jest 27, use \`tsconfig\` instead
PASS ./Hello.spec.ts
Hello Class
√ should create a new Hello

Test Suites: 1 passed, 1 total
Tests: 1 passed, 1 total
Snapshots: 0 total
Time: XXs
Ran all test suites.
================================================================================
`;

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`] = `
√ jest
↳ exit code: 0
Expand Down
16 changes: 0 additions & 16 deletions e2e/__tests__/logger.test.ts
Expand Up @@ -123,21 +123,5 @@ describe('ts-jest logging', () => {
})
})
})

describe('with tsConfig config', () => {
const testCase = configureTestCase('simple', {
tsJestConfig: {
tsConfig: true,
}
})

testCase.runWithTemplates(allPackageSetsWithPreset, 0, (runTest, { testLabel }) => {
it(testLabel, () => {
const result = runTest()
expect(result.status).toBe(0)
expect(result).toMatchSnapshot()
})
})
})
})
})
15 changes: 1 addition & 14 deletions src/__helpers__/fakers.ts
Expand Up @@ -4,7 +4,7 @@ import { resolve } from 'path'

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

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

export const rootDir = filePath('')

export function tsJestConfig(options?: Partial<TsJestConfig>): TsJestConfig {
return {
isolatedModules: false,
compiler: 'typescript',
transformers: options?.transformers ?? Object.create(null),
babelConfig: undefined,
tsConfig: undefined,
stringifyContentPathRegex: undefined,
diagnostics: { ignoreCodes: [], pretty: false, throws: true },
...options,
}
}

function getJestConfig<T extends Config.ProjectConfig>(
options?: Partial<Config.InitialOptions | Config.ProjectConfig>,
tsJestOptions?: TsJestGlobalOptions,
Expand Down