Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Allow jest.config.cts#14070

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
SimenB merged 12 commits intojestjs:mainfromDerTimonius:patch
Jan 5, 2024
Merged
Show file tree
Hide file tree
Changes from1 commit
Commits
Show all changes
12 commits
Select commitHold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
PrevPrevious commit
NextNext commit
implement suggested change, fix tests
  • Loading branch information
@DerTimonius
DerTimonius committedJan 4, 2024
commitf528d35a9b88bf37ab5f3cb2e13fcb3dc7cb0d5e
36 changes: 18 additions & 18 deletionse2e/__tests__/tsIntegration.test.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -58,9 +58,9 @@ describe('when `Config` type is imported from "@jest/types"', () => {
writeFiles(DIR, {
'__tests__/dummy.test.js': "test('dummy', () => expect(123).toBe(123));",
'jest.config.cts': `
/** @type {import('@jest/types').Config} */
const config: Config.InitialOptions = {displayName: 'ts-object-config', verbose: true};
export default config;
importtype {Config} from'@jest/types';
const config: Config.InitialOptions = {displayName: 'ts-object-config', verbose: true};
export default config;
`,
'package.json': '{}',
});
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': `
/** @type {import('@jest/types').Config} */
importtype {Config} from'@jest/types';
async function getVerbose() {return true;}
export default async (): Promise<Config.InitialOptions> => {
const verbose: Config.InitialOptions['verbose'] = await getVerbose();
Expand DownExpand 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': `
/** @type {import('@jest/types').Config} */
importtype {Config} from'@jest/types';
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': `
/** @type {import('@jest/types').Config} */
importtype {Config} from'@jest/types';
const config: Config.InitialOptions = {verbose: true};
export default get config;
`,
Expand DownExpand 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': `
/** @type {import('@jest/types').Config} */
importtype {Config} from'@jest/types';
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': `
/** @type {import('@jest/types').Config} */
importtype {Config} from'@jest/types';
async function getVerbose() {return true;}
export default async (): Promise<Config.InitialOptions> => {
const verbose: Config.InitialOptions['verbose'] = await getVerbose();
Expand DownExpand 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': `
/** @type {import('@jest/types').Config} */
importtype {Config} from'@jest/types';
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': `
/** @type {import('@jest/types').Config} */
importtype {Config} from'@jest/types';
const config: Config.InitialOptions = {verbose: true};
export default get config;
`,
Expand DownExpand 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': `
/** @type {import('@jest/types').Config}*/
importtype {Config}from 'jest';
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': `
/** @type {import('@jest/types').Config}*/
importtype {Config}from 'jest';
async function getVerbose() {return true;}
export default async (): Promise<Config> => {
const verbose: Config['verbose'] = await getVerbose();
Expand DownExpand 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': `
/** @type {import('@jest/types').Config}*/
importtype {Config}from 'jest';
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': `
/** @type {import('@jest/types').Config}*/
importtype {Config}from 'jest';
const config: Config = {verbose: true};
export default get config;
`,
Expand DownExpand 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': `
/** @type {import('@jest/types').Config}*/
importtype {Config}from 'jest';
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': `
/** @type {import('@jest/types').Config}*/
importtype {Config}from 'jest';
async function getVerbose() {return true;}
export default async (): Promise<Config> => {
const verbose: Config['verbose'] = await getVerbose();
Expand DownExpand 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': `
/** @type {import('@jest/types').Config}*/
importtype {Config}from 'jest';
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': `
/** @type {import('@jest/types').Config}*/
importtype {Config}from 'jest';
const config: Config = {verbose: true};
export default get config;
`,
Expand Down
4 changes: 3 additions & 1 deletionpackages/jest-config/src/readConfigFileAndSetRootDir.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -27,7 +27,9 @@ import {
export default async function readConfigFileAndSetRootDir(
configPath: string,
): Promise<Config.InitialOptions> {
const isTS = configPath.endsWith(JEST_CONFIG_EXT_TS || JEST_CONFIG_EXT_CTS);
const isTS =
configPath.endsWith(JEST_CONFIG_EXT_TS) ||
configPath.endsWith(JEST_CONFIG_EXT_CTS);
const isJSON = configPath.endsWith(JEST_CONFIG_EXT_JSON);
let configObject;

Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp