Skip to content

Commit bf0e377

Browse files
committed
Change type import for .cts files in integration tests
1 parent 80bbbf6 commit bf0e377

File tree

2 files changed

+17
-17
lines changed

2 files changed

+17
-17
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@
77
### Fixes
88

99
- `[jest-config]` Handle frozen config object ([#14054](https://github.com/facebook/jest/pull/14054))
10+
- `[jest-config]` Allow loading `jest.config.cts` files ([#14070](https://github.com/facebook/jest/pull/14070))
1011
- `[jest-environment-jsdom, jest-environment-node]` Fix assignment of `customExportConditions` via `testEnvironmentOptions` when custom env subclass defines a default value ([#13989](https://github.com/facebook/jest/pull/13989))
1112
- `[jest-matcher-utils]` Fix copying value of inherited getters ([#14007](https://github.com/facebook/jest/pull/14007))
1213
- `[jest-mock]` Tweak typings to allow `jest.replaceProperty()` replace methods ([#14008](https://github.com/facebook/jest/pull/14008))
1314
- `[jest-snapshot]` Fix a potential bug when not using prettier and improve performance ([#14036](https://github.com/facebook/jest/pull/14036))
1415
- `[@jest/transform]` Do not instrument `.json` modules ([#14048](https://github.com/facebook/jest/pull/14048))
15-
- `[jest-config]` Allow loading `jest.config.cts` files ([#14070](https://github.com/facebook/jest/pull/14070))
1616

1717
### Chore & Maintenance
1818

e2e/__tests__/tsIntegration.test.ts

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ describe('when `Config` type is imported from "@jest/types"', () => {
5858
writeFiles(DIR, {
5959
'__tests__/dummy.test.js': "test('dummy', () => expect(123).toBe(123));",
6060
'jest.config.cts': `
61-
import type {Config} from '@jest/types';
61+
/** @type {import('@jest/types').Config} */
6262
const config: Config.InitialOptions = {displayName: 'ts-object-config', verbose: true};
6363
export default config;
6464
`,
@@ -76,7 +76,7 @@ describe('when `Config` type is imported from "@jest/types"', () => {
7676
writeFiles(DIR, {
7777
'__tests__/dummy.test.js': "test('dummy', () => expect(123).toBe(123));",
7878
'jest.config.cts': `
79-
import type {Config} from '@jest/types';
79+
/** @type {import('@jest/types').Config} */
8080
async function getVerbose() {return true;}
8181
export default async (): Promise<Config.InitialOptions> => {
8282
const verbose: Config.InitialOptions['verbose'] = await getVerbose();
@@ -135,7 +135,7 @@ describe('when `Config` type is imported from "@jest/types"', () => {
135135
writeFiles(DIR, {
136136
'__tests__/dummy.test.js': "test('dummy', () => expect(123).toBe(123));",
137137
'jest.config.cts': `
138-
import type {Config} from '@jest/types';
138+
/** @type {import('@jest/types').Config} */
139139
const config: Config.InitialOptions = {testTimeout: '10000'};
140140
export default config;
141141
`,
@@ -154,7 +154,7 @@ describe('when `Config` type is imported from "@jest/types"', () => {
154154
writeFiles(DIR, {
155155
'__tests__/dummy.test.js': "test('dummy', () => expect(123).toBe(123));",
156156
'jest.config.cts': `
157-
import type {Config} from '@jest/types';
157+
/** @type {import('@jest/types').Config} */
158158
const config: Config.InitialOptions = {verbose: true};
159159
export default get config;
160160
`,
@@ -212,7 +212,7 @@ describe('when `Config` type is imported from "@jest/types"', () => {
212212
writeFiles(DIR, {
213213
'__tests__/dummy.test.js': "test('dummy', () => expect(12).toBe(12));",
214214
'jest.config.cts': `
215-
import type {Config} from '@jest/types';
215+
/** @type {import('@jest/types').Config} */
216216
const config: Config.InitialOptions = {displayName: 'ts-esm-object-config', verbose: true};
217217
export default config;
218218
`,
@@ -230,7 +230,7 @@ describe('when `Config` type is imported from "@jest/types"', () => {
230230
writeFiles(DIR, {
231231
'__tests__/dummy.test.js': "test('dummy', () => expect(12).toBe(12));",
232232
'jest.config.cts': `
233-
import type {Config} from '@jest/types';
233+
/** @type {import('@jest/types').Config} */
234234
async function getVerbose() {return true;}
235235
export default async (): Promise<Config.InitialOptions> => {
236236
const verbose: Config.InitialOptions['verbose'] = await getVerbose();
@@ -289,7 +289,7 @@ describe('when `Config` type is imported from "@jest/types"', () => {
289289
writeFiles(DIR, {
290290
'__tests__/dummy.test.js': "test('dummy', () => expect(12).toBe(12));",
291291
'jest.config.cts': `
292-
import type {Config} from '@jest/types';
292+
/** @type {import('@jest/types').Config} */
293293
const config: Config.InitialOptions = {testTimeout: '10000'};
294294
export default config;
295295
`,
@@ -308,7 +308,7 @@ describe('when `Config` type is imported from "@jest/types"', () => {
308308
writeFiles(DIR, {
309309
'__tests__/dummy.test.js': "test('dummy', () => expect(123).toBe(123));",
310310
'jest.config.cts': `
311-
import type {Config} from '@jest/types';
311+
/** @type {import('@jest/types').Config} */
312312
const config: Config.InitialOptions = {verbose: true};
313313
export default get config;
314314
`,
@@ -368,7 +368,7 @@ describe('when `Config` type is imported from "jest"', () => {
368368
writeFiles(DIR, {
369369
'__tests__/dummy.test.js': "test('dummy', () => expect(123).toBe(123));",
370370
'jest.config.cts': `
371-
import type {Config} from 'jest';
371+
/** @type {import('@jest/types').Config} */
372372
const config: Config = {displayName: 'ts-object-config', verbose: true};
373373
export default config;
374374
`,
@@ -386,7 +386,7 @@ describe('when `Config` type is imported from "jest"', () => {
386386
writeFiles(DIR, {
387387
'__tests__/dummy.test.js': "test('dummy', () => expect(123).toBe(123));",
388388
'jest.config.cts': `
389-
import type {Config} from 'jest';
389+
/** @type {import('@jest/types').Config} */
390390
async function getVerbose() {return true;}
391391
export default async (): Promise<Config> => {
392392
const verbose: Config['verbose'] = await getVerbose();
@@ -445,7 +445,7 @@ describe('when `Config` type is imported from "jest"', () => {
445445
writeFiles(DIR, {
446446
'__tests__/dummy.test.js': "test('dummy', () => expect(123).toBe(123));",
447447
'jest.config.cts': `
448-
import type {Config} from 'jest';
448+
/** @type {import('@jest/types').Config} */
449449
const config: Config = {testTimeout: '10000'};
450450
export default config;
451451
`,
@@ -464,7 +464,7 @@ describe('when `Config` type is imported from "jest"', () => {
464464
writeFiles(DIR, {
465465
'__tests__/dummy.test.js': "test('dummy', () => expect(123).toBe(123));",
466466
'jest.config.cts': `
467-
import type {Config} from 'jest';
467+
/** @type {import('@jest/types').Config} */
468468
const config: Config = {verbose: true};
469469
export default get config;
470470
`,
@@ -522,7 +522,7 @@ describe('when `Config` type is imported from "jest"', () => {
522522
writeFiles(DIR, {
523523
'__tests__/dummy.test.js': "test('dummy', () => expect(12).toBe(12));",
524524
'jest.config.cts': `
525-
import type {Config} from 'jest';
525+
/** @type {import('@jest/types').Config} */
526526
const config: Config = {displayName: 'ts-esm-object-config', verbose: true};
527527
export default config;
528528
`,
@@ -540,7 +540,7 @@ describe('when `Config` type is imported from "jest"', () => {
540540
writeFiles(DIR, {
541541
'__tests__/dummy.test.js': "test('dummy', () => expect(12).toBe(12));",
542542
'jest.config.cts': `
543-
import type {Config} from 'jest';
543+
/** @type {import('@jest/types').Config} */
544544
async function getVerbose() {return true;}
545545
export default async (): Promise<Config> => {
546546
const verbose: Config['verbose'] = await getVerbose();
@@ -599,7 +599,7 @@ describe('when `Config` type is imported from "jest"', () => {
599599
writeFiles(DIR, {
600600
'__tests__/dummy.test.js': "test('dummy', () => expect(12).toBe(12));",
601601
'jest.config.cts': `
602-
import type {Config} from 'jest';
602+
/** @type {import('@jest/types').Config} */
603603
const config: Config = {testTimeout: '10000'};
604604
export default config;
605605
`,
@@ -618,7 +618,7 @@ describe('when `Config` type is imported from "jest"', () => {
618618
writeFiles(DIR, {
619619
'__tests__/dummy.test.js': "test('dummy', () => expect(123).toBe(123));",
620620
'jest.config.cts': `
621-
import type {Config} from 'jest';
621+
/** @type {import('@jest/types').Config} */
622622
const config: Config = {verbose: true};
623623
export default get config;
624624
`,

0 commit comments

Comments
 (0)