-
Notifications
You must be signed in to change notification settings - Fork 625
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
feat: validate config with jest-validate #205
Conversation
Codecov Report
@@ Coverage Diff @@
## master #205 +/- ##
==========================================
+ Coverage 84.57% 84.59% +0.01%
==========================================
Files 133 134 +1
Lines 4377 4381 +4
Branches 681 681
==========================================
+ Hits 3702 3706 +4
Misses 598 598
Partials 77 77
Continue to review full report at Codecov.
|
This is so cool @thymikee, thanks for building this!
I agree, we only have |
Update: jestjs/jest#6802 |
jestjs/jest#6802 was merged, so now we wait for new Jest version to be released by @mjesun :) |
5c6c9c5
to
154e989
Compare
@thymikee can you rebase this PR with the new Jest version? I'll land it then :) |
…ation * upstream/master: (42 commits) Bump [email protected] Fix entryFile always is assumed to end with `.js` extension (facebook#310) Adds support for `publicPath` to enable serving assets from different locations. (facebook#299) Make dynamic import interoperable for CJS and ESM Add custom serializer (facebook#309) React sync for revisions 4773fdf...3ff2c7c metro-buck: disable inline IDs in dev mode Simplify helper function Rewrite traverseDependency-integration-tests to make them module resolution unit tests RN: Revert React 16.6 Sync React sync for revisions 4773fdf...bf9fadf Bump react-deep-force-update Use getFileIterator() from jest-haste-map Deploy Flow v0.85 to xplat/js metro-buck: add explicit import() prefetch feature jest: remove jasmine usages jest: upgrade to 24.0.0-alpha.4 Fix source map loading in the remote debugger Fix metro visualizer transformation Update babel to version 7 ...
…ation * upstream/master: (122 commits) Bump Metro to v0.53.0 Improve flow coverage in Metro Enable platform transforms for dev too, but keep it safe for MetroResolver Use function maps to symbolicate traces Move react-native-symbolicate to metro repo Migrated Metro from babel-jest to a custom transformer React sync for revisions f24a0da...8e25ed2 Revert D14168466: Perform security fixes Adds a missing dependency to metro Bumps antd to fix missing peerdeps Updates the package.json to match the Yarn output Improve prelude code Perform security fixes metro-buck: setup __DEV__ and other variables on the global object Add README and development script (facebook#292) Allow custom BABEL_ENV (facebook#364) Update siteConfig.js (facebook#327) docs: mention lerna in CONTRIBUTING.md (facebook#338) Revert D14024934: metro: keep track of significant dependencies ordering metro-buck: Hermes: no args to async wrapper if no prefetch ...
Looks like I'll need to sort out printing functions in |
Let me know once that part is ready so we can move ahead on this PR :) |
ping @thymikee let's make it happen? :) |
…ation * upstream/master: Upgrade jest to 24.5.0 Bump Prettier to 1.16.4 Bump Metro to v0.53.1 Another pass at Metro Flow annotation coverage Add CLI option to ignore function map Default to lazy requires for all public RN exports (facebook#362) FileStore now recreates parent cache folders if a write fails (facebook#370) Support symbolicating file:line:column stack frames Add connection verification Improve Flow annotation coverage in Metro Drop leading newline Deploy 0.94 to xplat Add new metro flag for running inspector proxy Perform security fixes
f6b895d
to
552cb07
Compare
Changed the test to avoid printing functions as it's Jest's responsibility to test the output (which also may slightly change at any time, so the test would be prone to errors). Regarding The CI failures seem unrelated. |
552cb07
to
efd0b79
Compare
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.
Thank you :)
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.
@cpojer is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
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.
@cpojer is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
Seems to fail at the import step, no idea why. Retrying. |
Can you share the error? |
Nothing from your side, I've been fixing this up for the last hour. |
Summary: **Summary** This PR introduces validation for the new `metro-config`. For now I'm keen on only validating new config, because I can see there's yet unused `convertConfig` which, I guess, defeats the purpose. Let me know otherwise. This is still work in progress, as I need to fix some stuff upstream (e.g. recursive object validation and pretty-printing). Just letting you know I'm working on it :) **Test plan** Added a test. cc CompuIves cpojer Pull Request resolved: facebook/metro#205 Differential Revision: D14501222 Pulled By: cpojer fbshipit-source-id: 0ab8f3ad14d6f33690d5f57fd1e7487f3a4a8c71
Summary
This PR introduces validation for the new
metro-config
. For now I'm keen on only validating new config, because I can see there's yet unusedconvertConfig
which, I guess, defeats the purpose. Let me know otherwise.This is still work in progress, as I need to fix some stuff upstream (e.g. recursive object validation and pretty-printing). Just letting you know I'm working on it :)
Test plan
Added a test.
cc @CompuIves @cpojer