-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[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 |
packages/jest-validate/src/types.js
Outdated
@@ -14,6 +14,7 @@ type Title = {| | |||
|}; | |||
|
|||
export type ValidationOptions = { | |||
blacklist?: Array<string>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
@@ -87,7 +93,7 @@ export default ({ | |||
skipNodeResolution: false, | |||
snapshotSerializers: ['my-serializer-module'], | |||
testEnvironment: 'jest-environment-jsdom', | |||
testEnvironmentOptions: {}, | |||
testEnvironmentOptions: {userAgent: 'Agent/007'}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
License to kill? 🕵🏼♂️
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔫
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
recursive
andrecursiveBlacklist
options tojest-validate
.recursive
- checks config recursive (deep check).true
by default.recursiveBlacklist
- a list of keyPaths to disable from recursive checks (helpful formoduleNameMapper
in Jest, which accepts all strings as valid object keys). I always confuseblacklist
withwhitelist
, so if you feel like this is rather a whitelist, let me know 😛JSON.stringify
for nicer examples (couldn't usepretty-format
as it adds constructors to printed strings)TODOs:
Test plan
Added tests