Some content is hidden

Large Commits have some content hidden by default. Use the searcx below for content that may be hidden.

42 files changed

+78
-85
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/** @type {import('../../../dist').InitialOptionsTsJest} */
1+
/** @type {import('../../../dist').JestConfigWithTsJest} */
22
module.exports = {
33
automock: true,
44
moduleNameMapper: {
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/** @type {import('../../../dist').InitialOptionsTsJest} */
1+
/** @type {import('../../../dist').JestConfigWithTsJest} */
22
module.exports = {
33
transform: {
44
'^.+.[tj]sx?$': [
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import type { InitialOptionsTsJest } from 'ts-jest'
1+
import type { JestConfigWithTsJest } from '../../dist'
22

3-
const jestCfg: InitialOptionsTsJest = {
3+
const jestCfg: JestConfigWithTsJest = {
44
transform: {
55
'^.+.tsx?$': [
66
'ts-jest',
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/** @type {import('../../dist').InitialOptionsTsJest} */
1+
/** @type {import('../../dist').JestConfigWithTsJest} */
22
module.exports = {
33
transform: {
44
'^.+.tsx?$': [
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/** @type {import('../../dist').InitialOptionsTsJest} */
1+
/** @type {import('../../dist').JestConfigWithTsJest} */
22
module.exports = {
33
collectCoverageFrom: ['**/*.js', '**/*.ts', '!**/node_modules/**', '!**/coverage/**'],
44
transform: {
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/** @type {import('../../dist').InitialOptionsTsJest} */
1+
/** @type {import('../../dist').JestConfigWithTsJest} */
22
module.exports = {
33
transform: {
44
'^.+.tsx?$': [
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/** @type {import('../../dist').InitialOptionsTsJest} */
1+
/** @type {import('../../dist').JestConfigWithTsJest} */
22
module.exports = {
33
transform: {
44
'^.+.tsx?$': [
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/** @type {import('../../dist').InitialOptionsTsJest} */
1+
/** @type {import('../../dist').JestConfigWithTsJest} */
22
module.exports = {
33
transform: {
44
'^.+.tsx?$': [
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/** @type {import('../../dist').InitialOptionsTsJest} */
1+
/** @type {import('../../dist').JestConfigWithTsJest} */
22
module.exports = {
33
transform: {
44
'^.+.tsx?$': [
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/** @type {import('../../dist').InitialOptionsTsJest} */
1+
/** @type {import('../../dist').JestConfigWithTsJest} */
22
module.exports = {
33
transform: {
44
'^.+.tsx?$': [
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/** @type {import('../../dist').InitialOptionsTsJest} */
1+
/** @type {import('../../dist').JestConfigWithTsJest} */
22
module.exports = {
33
transform: {
44
'^.+.tsx?$': [
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/** @type {import('../../dist').InitialOptionsTsJest} */
1+
/** @type {import('../../dist').JestConfigWithTsJest} */
22
module.exports = {
33
extensionsToTreatAsEsm: ['.ts'],
44
resolver: '<rootDir>/mjs-resolver.ts',
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/** @type {import('../../../dist').InitialOptionsTsJest} */
1+
/** @type {import('../../../dist').JestConfigWithTsJest} */
22
module.exports = {
33
displayName: 'sourcemap-disabled-isolated',
44
roots: ['<rootDir>', '<rootDir>/../__tests__'],
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/** @type {import('../../../dist').InitialOptionsTsJest} */
1+
/** @type {import('../../../dist').JestConfigWithTsJest} */
22
module.exports = {
33
displayName: 'sourcemap-disabled',
44
roots: ['<rootDir>', '<rootDir>/../__tests__'],
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/** @type {import('../../../dist').InitialOptionsTsJest} */
1+
/** @type {import('../../../dist').JestConfigWithTsJest} */
22
module.exports = {
33
displayName: 'sourcemap-enabled-isolated',
44
roots: ['<rootDir>', '<rootDir>/../__tests__'],
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/** @type {import('../../../dist').InitialOptionsTsJest} */
1+
/** @type {import('../../../dist').JestConfigWithTsJest} */
22
module.exports = {
33
displayName: 'sourcemap-enabled',
44
roots: ['<rootDir>', '<rootDir>/../__tests__'],
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/** @type {import('../../../dist').InitialOptionsTsJest} */
1+
/** @type {import('../../../dist').JestConfigWithTsJest} */
22
module.exports = {
33
displayName: 'babel-cjs-file',
44
roots: ['<rootDir>', '<rootDir>/../__tests__/for-babel'],
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/** @type {import('../../../dist').InitialOptionsTsJest} */
1+
/** @type {import('../../../dist').JestConfigWithTsJest} */
22
module.exports = {
33
displayName: 'babel-enabled',
44
roots: ['<rootDir>', '<rootDir>/../__tests__/for-babel'],
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/** @type {import('../../../dist').InitialOptionsTsJest} */
1+
/** @type {import('../../../dist').JestConfigWithTsJest} */
22
module.exports = {
33
displayName: 'babel-js-file',
44
roots: ['<rootDir>', '<rootDir>/../__tests__/for-babel'],
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/** @type {import('../../../dist').InitialOptionsTsJest} */
1+
/** @type {import('../../../dist').JestConfigWithTsJest} */
22
module.exports = {
33
displayName: 'no-type-check',
44
roots: ['<rootDir>', '<rootDir>/../__tests__/for-ts'],
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/** @type {import('../../../dist').InitialOptionsTsJest} */
1+
/** @type {import('../../../dist').JestConfigWithTsJest} */
22
module.exports = {
33
displayName: 'type-check',
44
roots: ['<rootDir>', '<rootDir>/../__tests__/for-ts'],
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/** @type {import('../../dist').InitialOptionsTsJest} */
1+
/** @type {import('../../dist').JestConfigWithTsJest} */
22
module.exports = {
33
testEnvironment: 'jsdom',
44
transform: {
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/** @type {import('ts-jest').InitialOptionsTsJest} */
1+
/** @type {import('ts-jest').JestConfigWithTsJest} */
22
module.exports = {
33
preset: 'ts-jest/presets/js-with-babel-esm',
44
transform: {
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/** @type {import('ts-jest').InitialOptionsTsJest} */
1+
/** @type {import('ts-jest').JestConfigWithTsJest} */
22
module.exports = {
33
preset: 'ts-jest/presets/js-with-babel-esm',
44
transform: {
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/** @type {import('ts-jest').InitialOptionsTsJest} */
1+
/** @type {import('ts-jest').JestConfigWithTsJest} */
22
module.exports = {
33
preset: 'ts-jest/presets/js-with-babel',
44
transform: {
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/** @type {import('ts-jest').InitialOptionsTsJest} */
1+
/** @type {import('ts-jest').JestConfigWithTsJest} */
22
module.exports = {
33
preset: 'ts-jest/presets/js-with-babel',
44
transform: {
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/** @type {import('ts-jest').InitialOptionsTsJest} */
1+
/** @type {import('ts-jest').JestConfigWithTsJest} */
22
module.exports = {
33
preset: 'ts-jest/presets/js-with-ts-esm',
44
transform: {
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/** @type {import('ts-jest').InitialOptionsTsJest} */
1+
/** @type {import('ts-jest').JestConfigWithTsJest} */
22
module.exports = {
33
preset: 'ts-jest/presets/js-with-ts-esm',
44
transform: {
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/** @type {import('ts-jest').InitialOptionsTsJest} */
1+
/** @type {import('ts-jest').JestConfigWithTsJest} */
22
module.exports = {
33
preset: 'ts-jest/presets/js-with-ts',
44
transform: {
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/** @type {import('ts-jest').InitialOptionsTsJest} */
1+
/** @type {import('ts-jest').JestConfigWithTsJest} */
22
module.exports = {
33
preset: 'ts-jest/presets/js-with-ts',
44
}
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
const baseEsmCfg = require('./jest-esm.config')
22
const baseCfg = require('./jest.config')
33

4-
/** @type {import('ts-jest').InitialOptionsTsJest} */
4+
/** @type {import('ts-jest').JestConfigWithTsJest} */
55
module.exports = {
66
...baseEsmCfg,
77
transform: {
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const baseCfg = require('./jest.config')
22

3-
/** @type {import('ts-jest').InitialOptionsTsJest} */
3+
/** @type {import('ts-jest').JestConfigWithTsJest} */
44
module.exports = {
55
...baseCfg,
66
preset: 'ts-jest/presets/js-with-babel-esm',
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const baseCfg = require('./jest.config')
22

3-
/** @type {import('ts-jest').InitialOptionsTsJest} */
3+
/** @type {import('ts-jest').JestConfigWithTsJest} */
44
module.exports = {
55
...baseCfg,
66
transform: {
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/** @type {import('ts-jest').InitialOptionsTsJest} */
1+
/** @type {import('ts-jest').JestConfigWithTsJest} */
22
module.exports = {
33
preset: 'ts-jest/presets/default-esm',
44
transform: {
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/** @type {import('ts-jest').InitialOptionsTsJest} */
1+
/** @type {import('ts-jest').JestConfigWithTsJest} */
22
module.exports = {
33
preset: 'ts-jest/presets/default-esm',
44
transform: {
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/** @type {import('ts-jest').InitialOptionsTsJest} */
1+
/** @type {import('ts-jest').JestConfigWithTsJest} */
22
module.exports = {
33
preset: 'ts-jest',
44
transform: {
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/** @type {import('ts-jest').InitialOptionsTsJest} */
1+
/** @type {import('ts-jest').JestConfigWithTsJest} */
22
module.exports = {
33
preset: 'ts-jest',
44
}
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/** @type {import('./dist').InitialOptionsTsJest} */
1+
/** @type {import('./dist').JestConfigWithTsJest} */
22
module.exports = {
33
collectCoverageFrom: ['src/**/*.ts'],
44
modulePathIgnorePatterns: ['examples/.*', 'website/.*'],
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ import type {
2727
BabelJestTransformer,
2828
ProjectConfigTsJest,
2929
TsJestAstTransformer,
30-
TsJestDiagnosticsCfg,
3130
TsJestGlobalOptions,
3231
TTypeScript,
3332
} from '../../types'
@@ -40,6 +39,14 @@ import { normalizeSlashes } from '../../utils/normalize-slashes'
4039
import { sha1 } from '../../utils/sha1'
4140
import { TSError } from '../../utils/ts-error'
4241

42+
interface TsJestDiagnosticsCfg {
43+
pretty: boolean
44+
ignoreCodes: number[]
45+
exclude: string[]
46+
throws: boolean
47+
warnOnly?: boolean
48+
}
49+
4350
/**
4451
* @internal
4552
*/
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,15 @@ declare module '@jest/types' {
2626
* @internal
2727
*/
2828
export type TBabelCore = typeof _babel
29+
/**
30+
* @internal
31+
*/
2932
export type TBabelJest = typeof babelJest
3033
export type TTypeScript = typeof _ts
3134
// Stimulate `esbuild` type to avoid import `esbuild` while building the assets which are shipped to npm
35+
/**
36+
* @internal
37+
*/
3238
export interface TEsBuild {
3339
transformSync(
3440
input: string,
@@ -62,6 +68,9 @@ export interface ConfigCustomTransformer {
6268
afterDeclarations?: Array<string | AstTransformer>
6369
}
6470

71+
/**
72+
* @deprecated use `TsJestTransformerOptions` instead
73+
*/
6574
export interface TsJestGlobalOptions {
6675
/**
6776
* Compiler options. It can be:
@@ -156,67 +165,44 @@ export interface TsJestGlobalOptions {
156165
useESM?: boolean
157166
}
158167

159-
interface TsJestConfig$tsConfig$file {
160-
kind: 'file'
161-
value: string | undefined
162-
}
163-
interface TsJestConfig$tsConfig$inline {
164-
kind: 'inline'
165-
value: _ts.CompilerOptions
166-
}
167-
type TsJestConfig$tsConfig = TsJestConfig$tsConfig$file | TsJestConfig$tsConfig$inline | undefined
168-
export interface TsJestDiagnosticsCfg {
169-
pretty: boolean
170-
ignoreCodes: number[]
171-
exclude: string[]
172-
throws: boolean
173-
warnOnly?: boolean
174-
}
175-
interface TsJestConfig$babelConfig$file {
176-
kind: 'file'
177-
value: string | undefined
178-
}
179-
interface TsJestConfig$babelConfig$inline {
180-
kind: 'inline'
181-
value: BabelConfig
182-
}
183-
type TsJestConfig$babelConfig = TsJestConfig$babelConfig$file | TsJestConfig$babelConfig$inline | undefined
184-
/**
185-
* @internal
186-
*/
187-
export interface TsJestConfig {
188-
tsconfig: TsJestConfig$tsConfig
189-
isolatedModules: boolean
190-
compiler: string
191-
diagnostics: TsJestDiagnosticsCfg
192-
babelConfig: TsJestConfig$babelConfig
193-
transformers: ConfigCustomTransformer
194-
// to deprecate / deprecated === === ===
195-
stringifyContentPathRegex: string | undefined
196-
}
197-
198168
/**
199169
* For transformers which extends `ts-jest`
170+
* @deprecated use `JestConfigWithTsJest` instead
200171
*/
201172
export interface ProjectConfigTsJest extends Config.ProjectConfig {
202173
globals: GlobalConfigTsJest
203174
}
175+
/**
176+
* @deprecated use `JestConfigWithTsJest` instead
177+
*/
204178
export interface TransformOptionsTsJest extends TransformOptions {
205179
config: ProjectConfigTsJest
206180
}
207181

208182
/**
209183
* For typings in `jest.config.ts`
184+
* @deprecated use `JestConfigWithTsJest` instead
210185
*/
211186
export interface GlobalConfigTsJest extends Config.ConfigGlobals {
212187
'ts-jest': TsJestGlobalOptions
213188
}
189+
/**
190+
* @deprecated use `JestConfigWithTsJest` instead
191+
*/
214192
export interface InitialOptionsTsJest extends Config.InitialOptions {
215193
globals?: GlobalConfigTsJest
216194
}
195+
type TsJestTransformerOptions = TsJestGlobalOptions
196+
export interface JestConfigWithTsJest extends Partial<Omit<Config.ProjectConfig, 'transform'>> {
197+
transform: {
198+
[regex: string]: 'ts-jest' | ['ts-jest', TsJestTransformerOptions] | string | [string, Record<string, unknown>]
199+
}
200+
}
217201

218202
export type StringMap = Map<string, string>
219-
203+
/**
204+
* @internal
205+
*/
220206
export interface DepGraphInfo {
221207
fileContent: string
222208
resolvedModuleNames: string[]

0 commit comments

Comments
 (0)