Skip to content

Commit

Permalink
fix(jest-config): do not warn about presets in project config (#13583)
Browse files Browse the repository at this point in the history
  • Loading branch information
SimenB committed Nov 8, 2022
1 parent dfc8711 commit 291f201
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

### Fixes

- `[jest-config]` Do not warn about `preset` in `ProjectConfig` [#13583](https://github.com/facebook/jest/pull/13583)

### Chore & Maintenance

### Performance
Expand Down
1 change: 1 addition & 0 deletions packages/jest-config/src/ValidConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,7 @@ export const initialProjectOptions: Config.InitialProjectOptions = {
},
modulePathIgnorePatterns: ['<rootDir>/build/'],
modulePaths: ['/shared/vendor/modules'],
preset: 'react-native',
prettierPath: '<rootDir>/node_modules/prettier',
resetMocks: false,
resetModules: false,
Expand Down
1 change: 1 addition & 0 deletions packages/jest-types/src/Config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,7 @@ export type ProjectConfig = {
moduleNameMapper: Array<[string, string]>;
modulePathIgnorePatterns: Array<string>;
modulePaths?: Array<string>;
preset?: string;
prettierPath: string;
resetMocks: boolean;
resetModules: boolean;
Expand Down
2 changes: 2 additions & 0 deletions packages/jest-validate/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ export const format = (value: unknown): string =>
export const formatPrettyObject = (value: unknown): string =>
typeof value === 'function'
? value.toString()
: typeof value === 'undefined'
? 'undefined'
: JSON.stringify(value, null, 2).split('\n').join('\n ');

export class ValidationError extends Error {
Expand Down

0 comments on commit 291f201

Please sign in to comment.