Skip to content

Commit b7caef6

Browse files
committed
bring DefaultConfig and ProjectConfig closer together
1 parent 25600ee commit b7caef6

File tree

2 files changed

+25
-5
lines changed

2 files changed

+25
-5
lines changed

packages/jest-config/src/Defaults.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,13 @@ const defaultOptions: Config.DefaultOptions = {
2727
coverageReporters: ['json', 'text', 'lcov', 'clover'],
2828
coverageThreshold: null,
2929
cwd: process.cwd(),
30-
dependencyExtractor: null,
30+
dependencyExtractor: undefined,
31+
detectLeaks: false,
32+
detectOpenHandles: false,
33+
displayName: null,
3134
errorOnDeprecated: false,
3235
expand: false,
36+
extraGlobals: [],
3337
filter: null,
3438
forceCoverageMatch: [],
3539
globalSetup: null,
@@ -42,8 +46,11 @@ const defaultOptions: Config.DefaultOptions = {
4246
maxConcurrency: 5,
4347
moduleDirectories: ['node_modules'],
4448
moduleFileExtensions: ['js', 'json', 'jsx', 'ts', 'tsx', 'node'],
49+
moduleLoader: null,
4550
moduleNameMapper: {},
4651
modulePathIgnorePatterns: [],
52+
modulePaths: [],
53+
name: null,
4754
noStackTrace: false,
4855
notify: false,
4956
notifyMode: 'failure-change',
@@ -61,6 +68,8 @@ const defaultOptions: Config.DefaultOptions = {
6168
setupFiles: [],
6269
setupFilesAfterEnv: [],
6370
skipFilter: false,
71+
skipNodeResolution: false,
72+
snapshotResolver: null,
6473
snapshotSerializers: [],
6574
testEnvironment: 'jest-environment-jsdom',
6675
testEnvironmentOptions: {},
@@ -75,6 +84,7 @@ const defaultOptions: Config.DefaultOptions = {
7584
timers: 'real',
7685
transform: null,
7786
transformIgnorePatterns: [NODE_MODULES_REGEXP],
87+
unmockedModulePathPatterns: [],
7888
useStderr: false,
7989
verbose: null,
8090
watch: false,

packages/jest-types/src/Config.ts

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,12 @@ export type DefaultOptions = {
4444
| undefined;
4545
cwd: Path;
4646
dependencyExtractor: string | null | undefined;
47+
detectLeaks: boolean;
48+
detectOpenHandles: boolean;
49+
displayName: string | null | undefined;
4750
errorOnDeprecated: boolean;
4851
expand: boolean;
52+
extraGlobals: Array<string>;
4953
filter: Path | null | undefined;
5054
forceCoverageMatch: Array<Glob>;
5155
globals: ConfigGlobals;
@@ -55,10 +59,13 @@ export type DefaultOptions = {
5559
maxConcurrency: number;
5660
moduleDirectories: Array<string>;
5761
moduleFileExtensions: Array<string>;
62+
moduleLoader: Path | null | undefined;
5863
moduleNameMapper: {
5964
[key: string]: string;
6065
};
6166
modulePathIgnorePatterns: Array<string>;
67+
modulePaths: Array<string>;
68+
name: string | null | undefined;
6269
noStackTrace: boolean;
6370
notify: boolean;
6471
notifyMode: string;
@@ -76,6 +83,8 @@ export type DefaultOptions = {
7683
setupFiles: Array<Path>;
7784
setupFilesAfterEnv: Array<Path>;
7885
skipFilter: boolean;
86+
skipNodeResolution: boolean;
87+
snapshotResolver: Path | null | undefined;
7988
snapshotSerializers: Array<Path>;
8089
testEnvironment: string;
8190
testEnvironmentOptions: Object;
@@ -96,6 +105,7 @@ export type DefaultOptions = {
96105
| undefined;
97106
transformIgnorePatterns: Array<Glob>;
98107
watchPathIgnorePatterns: Array<string>;
108+
unmockedModulePathPatterns: Array<string>;
99109
useStderr: boolean;
100110
verbose: boolean | null | undefined;
101111
watch: boolean;
@@ -124,7 +134,7 @@ export type InitialOptions = {
124134
[key: string]: number;
125135
};
126136
};
127-
dependencyExtractor?: string;
137+
dependencyExtractor?: string | null | undefined;
128138
detectLeaks?: boolean;
129139
detectOpenHandles?: boolean;
130140
displayName?: string;
@@ -147,7 +157,7 @@ export type InitialOptions = {
147157
maxConcurrency?: number;
148158
moduleDirectories?: Array<string>;
149159
moduleFileExtensions?: Array<string>;
150-
moduleLoader?: Path;
160+
moduleLoader?: Path | null | undefined;
151161
moduleNameMapper?: {
152162
[key: string]: string;
153163
};
@@ -308,7 +318,7 @@ export type ProjectConfig = {
308318
clearMocks: boolean;
309319
coveragePathIgnorePatterns: Array<string>;
310320
cwd: Path;
311-
dependencyExtractor?: string;
321+
dependencyExtractor: string | null | undefined;
312322
detectLeaks: boolean;
313323
detectOpenHandles: boolean;
314324
displayName: string | null | undefined;
@@ -322,7 +332,7 @@ export type ProjectConfig = {
322332
haste: HasteConfig;
323333
moduleDirectories: Array<string>;
324334
moduleFileExtensions: Array<string>;
325-
moduleLoader: Path;
335+
moduleLoader: Path | null | undefined;
326336
moduleNameMapper: Array<[string, string]>;
327337
modulePathIgnorePatterns: Array<string>;
328338
modulePaths: Array<string>;

0 commit comments

Comments
 (0)