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

Chai-should produced bad translation of chained property an #91

Open
sirreal opened this issue Nov 13, 2017 · 3 comments
Open

Chai-should produced bad translation of chained property an #91

sirreal opened this issue Nov 13, 2017 · 3 comments

Comments

@sirreal
Copy link
Contributor

sirreal commented Nov 13, 2017

The chai-should codemod produces a bad result when chaining property with a/an. See this diff produced:

expect( state )
-  .to.have.property( 'example.wordpress.com' )
-  .to.be.a( 'object' );
+ .expect( typeof state ).toBe( 'object' );

See failing tests with proposed codemod result in #92

Detected in Automattic/wp-calypso#19631 by @gziolo

@skovhus
Copy link
Owner

skovhus commented Nov 14, 2017

@sirreal thanks for reporting this! And thanks for the failing test.

@sirreal
Copy link
Contributor Author

sirreal commented Nov 14, 2017

You bet! Thanks for your work on the codemods 😀

@skovhus
Copy link
Owner

skovhus commented Nov 19, 2017

Chaining is currently unsupported in the chai-should... But it should be possible to add, like we did in the expect codemod. : )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants