-
-
Notifications
You must be signed in to change notification settings - Fork 222
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
Add smoke tests and harness #352
Conversation
@sebmarkbage @gaearon quick question: it looks like React doesn't use build/react.js (or others) for testing? What would I need to minify to ensure tests still pass with minified distribution file? |
We can't run existing tests against the minified file easily because we import some internal modules in tests. We've been trying to do this less (as we're working on a Fiber rewrite) but we still do it in some places. It would be nice to have a way to do it though. For example we could keep a whitelist of tests that are safe to run against the production bundle, and add a script that tells jest to use For a smoke test you could use these lines but run them against minified builds. |
Thanks, Dan. Let me see what I can do with this. |
…t) and automatic success check (pretty primitive for now but we'll see)
{ | ||
dir: "stylelint", | ||
// files: "lib/**/*.js", | ||
files: "lib/rules/declaration-block-properties-order/index.js", |
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.
@boopathi I think I found one example where mangler fails. Would be great if you could look into it (and/or check with your latest/local changes to the mangler). You can see it by running node smoke.js
after pulling git submodules (git submodule update --init --recursive
, IIUC)
@bmaurer cc'ing you in case you have any ideas/suggestions for this smoke test harness (see current todo in the description). My idea is basically to pull as many projects as possible, using git submodules (this way we can update them easily at any moment). Build those projects, minify them with Babili, then run unit tests, checking that everything still passes. We can eventually plug this into CI, making sure none of our bugfixes/additions introduce regressions. This is still in early stages but is already looking promising. For example, I confirmed Immutable.js failing few tests. After applying a patch, the failures went away. So this smoke suite would've caught it earlier. Current challenges are mostly related to figuring out what we need to minify for each project. Let me know what you think! |
This is great, I'm finding cases in "stylelint" where Babili makes it error out w/o "es2015" but not with "es2015" \o/ |
Hey @yyx990803, I apologize for summoning you out of the blue. I'm trying to run Vue as part of our smoke test harness and can't figure out which dist files are being used for tests. The idea is basically to minify Vue with our minifier and ensure all of Vue's unit tests still pass (essentially checking that minifier doesn't alter behavior). |
@kangax the unit tests are actually run directly using source files (bundled on the fly with The e2e tests are run against the |
TODO:
smoke()
calls. Right now they're async.glob
for when there's multiple files to minifynpm install
in draft-js errors out (Error onnpm install
facebookarchive/draft-js#891)npm install
output is not piped to stdoutnpm run build
etc. if it was just built)