diff --git a/CHANGELOG.md b/CHANGELOG.md index 5175c390dbbb..3d36d65c9cba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/packages/jest-config/src/ValidConfig.ts b/packages/jest-config/src/ValidConfig.ts index a5b9ebbf4386..7a1a3a59478c 100644 --- a/packages/jest-config/src/ValidConfig.ts +++ b/packages/jest-config/src/ValidConfig.ts @@ -261,6 +261,7 @@ export const initialProjectOptions: Config.InitialProjectOptions = { }, modulePathIgnorePatterns: ['/build/'], modulePaths: ['/shared/vendor/modules'], + preset: 'react-native', prettierPath: '/node_modules/prettier', resetMocks: false, resetModules: false, diff --git a/packages/jest-types/src/Config.ts b/packages/jest-types/src/Config.ts index c8cfebd40625..d0a62f3e431d 100644 --- a/packages/jest-types/src/Config.ts +++ b/packages/jest-types/src/Config.ts @@ -448,6 +448,7 @@ export type ProjectConfig = { moduleNameMapper: Array<[string, string]>; modulePathIgnorePatterns: Array; modulePaths?: Array; + preset?: string; prettierPath: string; resetMocks: boolean; resetModules: boolean; diff --git a/packages/jest-validate/src/utils.ts b/packages/jest-validate/src/utils.ts index a28fe979e41a..b91b7ee32eb8 100644 --- a/packages/jest-validate/src/utils.ts +++ b/packages/jest-validate/src/utils.ts @@ -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 {