[jest-validate] support recursive config check#6802
Conversation
577ae0b to
432c952
Compare
Codecov Report
@@ Coverage Diff @@
## master #6802 +/- ##
==========================================
+ Coverage 63.55% 63.59% +0.03%
==========================================
Files 235 235
Lines 9030 9042 +12
Branches 3 4 +1
==========================================
+ Hits 5739 5750 +11
- Misses 3290 3291 +1
Partials 1 1
Continue to review full report at Codecov.
|
|
I'm not sure if we need the |
| |}; | ||
|
|
||
| export type ValidationOptions = { | ||
| blacklist?: Array<string>, |
There was a problem hiding this comment.
recursiveBlacklist? Or something like that, I think it should be tied to what the blacklist is for, so I don't have to look up the docs
|
I was thinking of modules like Prettier (cc @azz), or maybe some other ones that would break after this change. |
|
Updated. |
|
@endiliey the Netlify preview is failing again. Can you have a look? |
|
@thymikee done. Retrying the deploy & clearing netlify build cache solved it. |
| snapshotSerializers: ['my-serializer-module'], | ||
| testEnvironment: 'jest-environment-jsdom', | ||
| testEnvironmentOptions: {}, | ||
| testEnvironmentOptions: {userAgent: 'Agent/007'}, |
|
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Summary
Adds
recursiveandrecursiveBlacklistoptions tojest-validate.recursive- checks config recursive (deep check).trueby default.recursiveBlacklist- a list of keyPaths to disable from recursive checks (helpful formoduleNameMapperin Jest, which accepts all strings as valid object keys). I always confuseblacklistwithwhitelist, so if you feel like this is rather a whitelist, let me know 😛JSON.stringifyfor nicer examples (couldn't usepretty-formatas it adds constructors to printed strings)TODOs:
Test plan
Added tests