Conversation
test/testSetupFile.js
Outdated
| @@ -0,0 +1,2 @@ | |||
| /* eslint-env jasmine */ | |||
| jasmine.DEFAULT_TIMEOUT_INTERVAL = 10000; | |||
| @@ -32,11 +43,4 @@ if (process.env.BABEL_ENV === "cov") { | |||
| config.plugins.push("babel-plugin-istanbul"); | |||
There was a problem hiding this comment.
should this still be here? Jest adds it itself (and you removed it from package.json)
| @@ -40,7 +40,6 @@ const config = { | |||
|
|
|||
| if (process.env.BABEL_ENV === "cov") { | |||
| config.auxiliaryCommentBefore = "istanbul ignore next"; | |||
There was a problem hiding this comment.
|
I think there is no need to use the mocha runner, because just using the default jest runner works fine. |
| - '9' | ||
| - '8' | ||
| - '6' | ||
| - '4' |
There was a problem hiding this comment.
This seems unrelated? We are we dropping node 4 testing already?
There was a problem hiding this comment.
Can use node environment and keep 4? (like in babel-upgrade)
There was a problem hiding this comment.
If it's because of jest, it still works on node 4 if you use the node environment - https://github.com/babel/babel-upgrade works fine with it.
| if (!deprecationWarningShown) { | ||
| deprecationWarningShown = true; | ||
|
|
||
| const deprecationError = new Error( |
There was a problem hiding this comment.
I'm ok with just not doing the warning anymore and making this a breaking change. We can just fix this automatically with https://github.com/babel/babel-upgrade
There was a problem hiding this comment.
We can do this in a separate PR.
|
I agree with @danez! The Mocha runner is a good option when the complexity of the codebase makes it hard to fully migrate to Jest or as an intermediate step. Seem that I'll close it in favor of this, I can reopen it if needed. |
|
Ok well if this works I'm for it too 👍 , thanks for your efforts @rogeliog, sorry we didn't actually end up merging the PR 😅 |
|
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/7039/ |
existentialism
left a comment
There was a problem hiding this comment.
Let's get this landed!
|
Ok I hope the coverage is now correct. Okay I reverted this change and instead we test the transpiled code in |
|
Anything jest can do to help/improve, or is it just a quirk (feature) of babel's tests? |
|
I think that we in the past implemented some features that jest might already do, like running each test in a spearate vm (https://github.com/babel/babel/blob/master/packages/babel-helper-transform-fixture-test-runner/src/index.js#L87). |
|
Super cool 👍I was wondering - it should be possible to migrate to builtin snapshots instead of custom setup in the future, right? This would allow easier test updates |
|
I actually like the individual files lol compared to reading the snapshot output now lol |
|
What's the difference though? A single snapshot format? Maybe it's possible to integrate with snapshot system to output whatever we want in whatever directory we want, just have it backed by jest's built-in system for this. |
|
Oh ok if you can change the format then that's cool. I just mean https://github.com/babel/babel-upgrade/blob/51534a4bd3f742d284d42e231ae36e71c83bc93d/__tests__/__snapshots__/packageData.test.js.snap#L5-L12 vs the actual js |
|
Actually I have no idea if its possible to change the whole format, it's for sure possible to write custom serializer, but not sure if a snapshot file can be an actual js file, not assigned to exports etc (jest snapshots are actually requireable). Worth investigating in the future |
Rebase of #6179. Seems i removed my fork repo. :)
All tests work, babel-register is skipped for now. But I have an idea how to fix it, by mocking pirates and just checking what babel-register is doing, pirates is covered with tests anyway so we don't have to test it.