Skip to content

Commit

Permalink
Change type import for .cts files in integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
DerTimonius committed Apr 29, 2023
1 parent 80bbbf6 commit bf0e377
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
### Fixes

- `[jest-config]` Handle frozen config object ([#14054](https://github.com/facebook/jest/pull/14054))
- `[jest-config]` Allow loading `jest.config.cts` files ([#14070](https://github.com/facebook/jest/pull/14070))
- `[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))
- `[jest-matcher-utils]` Fix copying value of inherited getters ([#14007](https://github.com/facebook/jest/pull/14007))
- `[jest-mock]` Tweak typings to allow `jest.replaceProperty()` replace methods ([#14008](https://github.com/facebook/jest/pull/14008))
- `[jest-snapshot]` Fix a potential bug when not using prettier and improve performance ([#14036](https://github.com/facebook/jest/pull/14036))
- `[@jest/transform]` Do not instrument `.json` modules ([#14048](https://github.com/facebook/jest/pull/14048))
- `[jest-config]` Allow loading `jest.config.cts` files ([#14070](https://github.com/facebook/jest/pull/14070))

### Chore & Maintenance

Expand Down
32 changes: 16 additions & 16 deletions e2e/__tests__/tsIntegration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ describe('when `Config` type is imported from "@jest/types"', () => {
writeFiles(DIR, {
'__tests__/dummy.test.js': "test('dummy', () => expect(123).toBe(123));",
'jest.config.cts': `
import type {Config} from '@jest/types';
/** @type {import('@jest/types').Config} */
const config: Config.InitialOptions = {displayName: 'ts-object-config', verbose: true};
export default config;
`,
Expand All @@ -76,7 +76,7 @@ describe('when `Config` type is imported from "@jest/types"', () => {
writeFiles(DIR, {
'__tests__/dummy.test.js': "test('dummy', () => expect(123).toBe(123));",
'jest.config.cts': `
import type {Config} from '@jest/types';
/** @type {import('@jest/types').Config} */
async function getVerbose() {return true;}
export default async (): Promise<Config.InitialOptions> => {
const verbose: Config.InitialOptions['verbose'] = await getVerbose();
Expand Down Expand Up @@ -135,7 +135,7 @@ describe('when `Config` type is imported from "@jest/types"', () => {
writeFiles(DIR, {
'__tests__/dummy.test.js': "test('dummy', () => expect(123).toBe(123));",
'jest.config.cts': `
import type {Config} from '@jest/types';
/** @type {import('@jest/types').Config} */
const config: Config.InitialOptions = {testTimeout: '10000'};
export default config;
`,
Expand All @@ -154,7 +154,7 @@ describe('when `Config` type is imported from "@jest/types"', () => {
writeFiles(DIR, {
'__tests__/dummy.test.js': "test('dummy', () => expect(123).toBe(123));",
'jest.config.cts': `
import type {Config} from '@jest/types';
/** @type {import('@jest/types').Config} */
const config: Config.InitialOptions = {verbose: true};
export default get config;
`,
Expand Down Expand Up @@ -212,7 +212,7 @@ describe('when `Config` type is imported from "@jest/types"', () => {
writeFiles(DIR, {
'__tests__/dummy.test.js': "test('dummy', () => expect(12).toBe(12));",
'jest.config.cts': `
import type {Config} from '@jest/types';
/** @type {import('@jest/types').Config} */
const config: Config.InitialOptions = {displayName: 'ts-esm-object-config', verbose: true};
export default config;
`,
Expand All @@ -230,7 +230,7 @@ describe('when `Config` type is imported from "@jest/types"', () => {
writeFiles(DIR, {
'__tests__/dummy.test.js': "test('dummy', () => expect(12).toBe(12));",
'jest.config.cts': `
import type {Config} from '@jest/types';
/** @type {import('@jest/types').Config} */
async function getVerbose() {return true;}
export default async (): Promise<Config.InitialOptions> => {
const verbose: Config.InitialOptions['verbose'] = await getVerbose();
Expand Down Expand Up @@ -289,7 +289,7 @@ describe('when `Config` type is imported from "@jest/types"', () => {
writeFiles(DIR, {
'__tests__/dummy.test.js': "test('dummy', () => expect(12).toBe(12));",
'jest.config.cts': `
import type {Config} from '@jest/types';
/** @type {import('@jest/types').Config} */
const config: Config.InitialOptions = {testTimeout: '10000'};
export default config;
`,
Expand All @@ -308,7 +308,7 @@ describe('when `Config` type is imported from "@jest/types"', () => {
writeFiles(DIR, {
'__tests__/dummy.test.js': "test('dummy', () => expect(123).toBe(123));",
'jest.config.cts': `
import type {Config} from '@jest/types';
/** @type {import('@jest/types').Config} */
const config: Config.InitialOptions = {verbose: true};
export default get config;
`,
Expand Down Expand Up @@ -368,7 +368,7 @@ describe('when `Config` type is imported from "jest"', () => {
writeFiles(DIR, {
'__tests__/dummy.test.js': "test('dummy', () => expect(123).toBe(123));",
'jest.config.cts': `
import type {Config} from 'jest';
/** @type {import('@jest/types').Config} */
const config: Config = {displayName: 'ts-object-config', verbose: true};
export default config;
`,
Expand All @@ -386,7 +386,7 @@ describe('when `Config` type is imported from "jest"', () => {
writeFiles(DIR, {
'__tests__/dummy.test.js': "test('dummy', () => expect(123).toBe(123));",
'jest.config.cts': `
import type {Config} from 'jest';
/** @type {import('@jest/types').Config} */
async function getVerbose() {return true;}
export default async (): Promise<Config> => {
const verbose: Config['verbose'] = await getVerbose();
Expand Down Expand Up @@ -445,7 +445,7 @@ describe('when `Config` type is imported from "jest"', () => {
writeFiles(DIR, {
'__tests__/dummy.test.js': "test('dummy', () => expect(123).toBe(123));",
'jest.config.cts': `
import type {Config} from 'jest';
/** @type {import('@jest/types').Config} */
const config: Config = {testTimeout: '10000'};
export default config;
`,
Expand All @@ -464,7 +464,7 @@ describe('when `Config` type is imported from "jest"', () => {
writeFiles(DIR, {
'__tests__/dummy.test.js': "test('dummy', () => expect(123).toBe(123));",
'jest.config.cts': `
import type {Config} from 'jest';
/** @type {import('@jest/types').Config} */
const config: Config = {verbose: true};
export default get config;
`,
Expand Down Expand Up @@ -522,7 +522,7 @@ describe('when `Config` type is imported from "jest"', () => {
writeFiles(DIR, {
'__tests__/dummy.test.js': "test('dummy', () => expect(12).toBe(12));",
'jest.config.cts': `
import type {Config} from 'jest';
/** @type {import('@jest/types').Config} */
const config: Config = {displayName: 'ts-esm-object-config', verbose: true};
export default config;
`,
Expand All @@ -540,7 +540,7 @@ describe('when `Config` type is imported from "jest"', () => {
writeFiles(DIR, {
'__tests__/dummy.test.js': "test('dummy', () => expect(12).toBe(12));",
'jest.config.cts': `
import type {Config} from 'jest';
/** @type {import('@jest/types').Config} */
async function getVerbose() {return true;}
export default async (): Promise<Config> => {
const verbose: Config['verbose'] = await getVerbose();
Expand Down Expand Up @@ -599,7 +599,7 @@ describe('when `Config` type is imported from "jest"', () => {
writeFiles(DIR, {
'__tests__/dummy.test.js': "test('dummy', () => expect(12).toBe(12));",
'jest.config.cts': `
import type {Config} from 'jest';
/** @type {import('@jest/types').Config} */
const config: Config = {testTimeout: '10000'};
export default config;
`,
Expand All @@ -618,7 +618,7 @@ describe('when `Config` type is imported from "jest"', () => {
writeFiles(DIR, {
'__tests__/dummy.test.js': "test('dummy', () => expect(123).toBe(123));",
'jest.config.cts': `
import type {Config} from 'jest';
/** @type {import('@jest/types').Config} */
const config: Config = {verbose: true};
export default get config;
`,
Expand Down

0 comments on commit bf0e377

Please sign in to comment.