Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
Prev Previous commit
Next Next commit
make recursive true by default
  • Loading branch information
thymikee committed Aug 6, 2018
commit d4bc3fc3b6708c2e3ef87a27111bb592153d055b
1 change: 0 additions & 1 deletion packages/jest-config/src/normalize.js
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,6 @@ export default function normalize(options: InitialOptions, argv: Argv) {
comment: DOCUMENTATION_NOTE,
deprecatedConfig: DEPRECATED_CONFIG,
exampleConfig: VALID_CONFIG,
recursive: true,
recursiveBlacklist: [
'collectCoverageOnlyFrom',
// 'coverageThreshold' allows to use 'global' and glob strings on the same
Expand Down
5 changes: 2 additions & 3 deletions packages/jest-validate/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,13 @@ Almost anything can be overwritten to suite your needs.

### Options

- `blacklist` – optional array of string keyPaths that should be excluded from deep (recursive) validation.
- `recursiveBlacklist` – optional array of string keyPaths that should be excluded from deep (recursive) validation.
- `comment` – optional string to be rendered below error/warning message.
- `condition` – an optional function with validation condition.
- `deprecate`, `error`, `unknown` – optional functions responsible for displaying warning and error messages.
- `deprecatedConfig` – optional object with deprecated config keys.
- `exampleConfig` – the only **required** option with configuration against which you'd like to test.
- `recursive` - optional boolean determining whether recursively compare `exampleConfig` to `config`.
- `recursive` - optional boolean determining whether recursively compare `exampleConfig` to `config` (default: `true`).
- `title` – optional object of titles for errors and messages.

You will find examples of `condition`, `deprecate`, `error`, `unknown`, and `deprecatedConfig` inside source of this repository, named respectively.
Expand All @@ -88,7 +88,6 @@ validate(config, {
comment: ' Documentation: http://custom-docs.com',
deprecatedConfig,
exampleConfig,
recursive: true,
title: {
deprecation: 'Custom Deprecation',
// leaving 'error' and 'warning' as default
Expand Down
10 changes: 1 addition & 9 deletions packages/jest-validate/src/__tests__/validate.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ test('recursively validates default Jest config', () => {
expect(
validate(defaultConfig, {
exampleConfig: validConfig,
recursive: true,
}),
).toEqual({
hasDeprecationWarnings: false,
Expand All @@ -34,7 +33,6 @@ test('recursively validates default jest-validate config', () => {
expect(
validate(jestValidateDefaultConfig, {
exampleConfig: jestValidateExampleConfig,
recursive: true,
}),
).toEqual({
hasDeprecationWarnings: false,
Expand All @@ -61,7 +59,6 @@ test(`pretty prints valid config for Function`, () => {
expect(() =>
validate(config, {
exampleConfig: validConfig,
recursive: true,
}),
).toThrowErrorMatchingSnapshot();
});
Expand Down Expand Up @@ -110,18 +107,14 @@ test('respects blacklist', () => {
},
};

validate(config, {
exampleConfig,
recursive: true,
});
validate(config, {exampleConfig});

expect(console.warn).toBeCalled();

console.warn.mockReset();

validate(config, {
exampleConfig,
recursive: true,
recursiveBlacklist: ['something.nested'],
});

Expand Down Expand Up @@ -150,7 +143,6 @@ test('displays warning for deprecated config options', () => {
validate(config, {
deprecatedConfig,
exampleConfig: validConfig,
recursive: true,
}),
).toEqual({
hasDeprecationWarnings: true,
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-validate/src/default_config.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export default ({
deprecatedConfig: {},
error: errorMessage,
exampleConfig: {},
recursive: false,
recursive: true,
recursiveBlacklist: [],
title: {
deprecation: DEPRECATION,
Expand Down