Skip to content
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

WIP: Migrate to jest #6179

Closed
wants to merge 8 commits into from
Closed

WIP: Migrate to jest #6179

wants to merge 8 commits into from

Conversation

danez
Copy link
Member

@danez danez commented Aug 31, 2017

Q A
Patch: Bug Fix? No
Major: Breaking Change? No
Minor: New Feature? Yes
Deprecations? No
Spec Compliancy? Yes
Tests Added/Pass? Yes
Fixed Tickets Fixes #5197, Fixes #5359
License MIT
Doc PR No
Dependency Changes Yes

Rebase and squash of #5359

This does not work correctly so far because jestjs/jest#4393 is not released yet.

Some tests are not working and I haven't found a solution or did not look at them yet.

  • All babel-register tests fail, because we cannot really use babel-register inside the jest-node-environment and we do not have access to a real require inside the test. Not sure what we should do here. Even if i try to write our own environment that runs in the same context, require would still be hijacked by jest and not do the real internal require cycle I think?
  • babel-plugin-transform-es2015-block-scoping/general › label fails because babylon cannot parse the source.
  • packages/babel-core/test/api.js - complex plugin and preset ordering is failing because the order does not match. Not sure why.

//cc @cpojer

@mention-bot
Copy link

@danez, thanks for your PR! By analyzing the history of the files in this pull request, we identified @existentialism, @hzoo and @motiz88 to be potential reviewers.

@danez danez closed this Aug 31, 2017
@danez danez reopened this Aug 31, 2017
@danez danez changed the base branch from 7.0 to master August 31, 2017 16:12
@thymikee
Copy link
Contributor

thymikee commented Sep 6, 2017

@danez we recently released new major.

@danez
Copy link
Member Author

danez commented Oct 13, 2017

I dived deep into the jest source just to find out that I don't see any way we can use jest to test babel-register. Require hooks seem to not be testable with jest, because jest has it's own require implementation that does not respect require hooks.

So we could either stay with mocha, or migrate to ava (meh) or use jest and only for babel-register use another test framework? Thoughts?

@thymikee
Copy link
Contributor

@danez I actually encountered similar issues testing babel-register dependent code, and the workaround was to use Node's module directly, which was pain.
However, now you could use jest-mocha-runner for testing babel-register code (Jest can run Mocha as a test runner). cc @rogeliog

@SimenB
Copy link
Contributor

SimenB commented Oct 14, 2017

@thymikee: #6442

@existentialism existentialism added this to the Babel 7.next milestone Jan 11, 2018
@danez danez mentioned this pull request Feb 28, 2018
@danez danez closed this Feb 28, 2018
@lock lock bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Oct 5, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Oct 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: tests outdated A closed issue/PR that is archived due to age. Recommended to make a new issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[7.0] Tests: switch to jest
7 participants