Skip to content

Commit

Permalink
bring DefaultConfig and ProjectConfig closer together
Browse files Browse the repository at this point in the history
  • Loading branch information
jeysal committed Feb 24, 2019
1 parent 25600ee commit b7caef6
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 5 deletions.
12 changes: 11 additions & 1 deletion packages/jest-config/src/Defaults.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,13 @@ const defaultOptions: Config.DefaultOptions = {
coverageReporters: ['json', 'text', 'lcov', 'clover'],
coverageThreshold: null,
cwd: process.cwd(),
dependencyExtractor: null,
dependencyExtractor: undefined,
detectLeaks: false,
detectOpenHandles: false,
displayName: null,
errorOnDeprecated: false,
expand: false,
extraGlobals: [],
filter: null,
forceCoverageMatch: [],
globalSetup: null,
Expand All @@ -42,8 +46,11 @@ const defaultOptions: Config.DefaultOptions = {
maxConcurrency: 5,
moduleDirectories: ['node_modules'],
moduleFileExtensions: ['js', 'json', 'jsx', 'ts', 'tsx', 'node'],
moduleLoader: null,
moduleNameMapper: {},
modulePathIgnorePatterns: [],
modulePaths: [],
name: null,
noStackTrace: false,
notify: false,
notifyMode: 'failure-change',
Expand All @@ -61,6 +68,8 @@ const defaultOptions: Config.DefaultOptions = {
setupFiles: [],
setupFilesAfterEnv: [],
skipFilter: false,
skipNodeResolution: false,
snapshotResolver: null,
snapshotSerializers: [],
testEnvironment: 'jest-environment-jsdom',
testEnvironmentOptions: {},
Expand All @@ -75,6 +84,7 @@ const defaultOptions: Config.DefaultOptions = {
timers: 'real',
transform: null,
transformIgnorePatterns: [NODE_MODULES_REGEXP],
unmockedModulePathPatterns: [],
useStderr: false,
verbose: null,
watch: false,
Expand Down
18 changes: 14 additions & 4 deletions packages/jest-types/src/Config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,12 @@ export type DefaultOptions = {
| undefined;
cwd: Path;
dependencyExtractor: string | null | undefined;
detectLeaks: boolean;
detectOpenHandles: boolean;
displayName: string | null | undefined;
errorOnDeprecated: boolean;
expand: boolean;
extraGlobals: Array<string>;
filter: Path | null | undefined;
forceCoverageMatch: Array<Glob>;
globals: ConfigGlobals;
Expand All @@ -55,10 +59,13 @@ export type DefaultOptions = {
maxConcurrency: number;
moduleDirectories: Array<string>;
moduleFileExtensions: Array<string>;
moduleLoader: Path | null | undefined;
moduleNameMapper: {
[key: string]: string;
};
modulePathIgnorePatterns: Array<string>;
modulePaths: Array<string>;
name: string | null | undefined;
noStackTrace: boolean;
notify: boolean;
notifyMode: string;
Expand All @@ -76,6 +83,8 @@ export type DefaultOptions = {
setupFiles: Array<Path>;
setupFilesAfterEnv: Array<Path>;
skipFilter: boolean;
skipNodeResolution: boolean;
snapshotResolver: Path | null | undefined;
snapshotSerializers: Array<Path>;
testEnvironment: string;
testEnvironmentOptions: Object;
Expand All @@ -96,6 +105,7 @@ export type DefaultOptions = {
| undefined;
transformIgnorePatterns: Array<Glob>;
watchPathIgnorePatterns: Array<string>;
unmockedModulePathPatterns: Array<string>;
useStderr: boolean;
verbose: boolean | null | undefined;
watch: boolean;
Expand Down Expand Up @@ -124,7 +134,7 @@ export type InitialOptions = {
[key: string]: number;
};
};
dependencyExtractor?: string;
dependencyExtractor?: string | null | undefined;
detectLeaks?: boolean;
detectOpenHandles?: boolean;
displayName?: string;
Expand All @@ -147,7 +157,7 @@ export type InitialOptions = {
maxConcurrency?: number;
moduleDirectories?: Array<string>;
moduleFileExtensions?: Array<string>;
moduleLoader?: Path;
moduleLoader?: Path | null | undefined;
moduleNameMapper?: {
[key: string]: string;
};
Expand Down Expand Up @@ -308,7 +318,7 @@ export type ProjectConfig = {
clearMocks: boolean;
coveragePathIgnorePatterns: Array<string>;
cwd: Path;
dependencyExtractor?: string;
dependencyExtractor: string | null | undefined;
detectLeaks: boolean;
detectOpenHandles: boolean;
displayName: string | null | undefined;
Expand All @@ -322,7 +332,7 @@ export type ProjectConfig = {
haste: HasteConfig;
moduleDirectories: Array<string>;
moduleFileExtensions: Array<string>;
moduleLoader: Path;
moduleLoader: Path | null | undefined;
moduleNameMapper: Array<[string, string]>;
modulePathIgnorePatterns: Array<string>;
modulePaths: Array<string>;
Expand Down

0 comments on commit b7caef6

Please sign in to comment.