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

Improve mocha transformer (webpack feedback) #109

Closed
skovhus opened this issue Apr 30, 2018 · 3 comments
Closed

Improve mocha transformer (webpack feedback) #109

skovhus opened this issue Apr 30, 2018 · 3 comments

Comments

@skovhus
Copy link
Owner

skovhus commented Apr 30, 2018

See webpack/webpack@5a8083a#commitcomment-28797796

skovhus referenced this issue in webpack/webpack Apr 30, 2018
used regexps:

([\(\)a-zA-Z0-9\."'/ +{}\[\]=\-,:?_!]+)\.should\.be\.eql
➡️
expect($1).toBe

expect\(([\(\)a-zA-Z0-9\."'/ +{}\[\]=\-,:?_!]+)\)\.toBe\(\[
➡️
expect($1).toEqual([

expect\(([\(\)a-zA-Z0-9\."'/ +{}\[\]=\-,:?_!]+)\)\.toBe\(\{
➡️
expect($1).toEqual({
@niieani
Copy link

niieani commented Apr 30, 2018

I think the codemods crashed on some files altogether, in some cases. You'll need to try it out yourself to see where things went wrong! :)

@skovhus
Copy link
Owner Author

skovhus commented May 14, 2018

@niieani thanks.

I've checked out webpack (commit: webpack/webpack@009772c) and ran jest-codemods on the entire test folder. It gives the following result:

[email protected] (with [email protected]):
122 errors / 278 ok

jest-codemods mainly fails due to all the invalid .js files with test fixtures. But there is also some issues with the babylon parser and issues with unsupported should.js constructs (expect(typeof id).to.be.oneOf("number", "string")).

After upgrading jscodeshift, then result now looks a bit better.

[email protected] [email protected]:
46 errors / 299 ok

TODO

@skovhus skovhus changed the title Improve mocha transformer Improve mocha transformer (webpack feedback) May 14, 2018
@skovhus
Copy link
Owner Author

skovhus commented May 14, 2018

Replaced by #116

@skovhus skovhus closed this as completed May 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants