-
Notifications
You must be signed in to change notification settings - Fork 27k
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
Styled-jsx import issue when running test with Jest #1037
Comments
Use But it'll have issues in the Node.js. So, you need to use the ^^^ plugin. |
@thangngoc89 actually, we need to use the |
Reopen, if the issue still exists. |
@arunoda as you can see in my config, I'm using babel-preset-latest, it covers es2015 as well as es2016. If you looks closely to the error dump, you can see that only the styled-jsx import statement wasn't transpiled by babel, others statements are transpiled properly. If I remove next/babel, the problem goes away. It's probably because of style-jsx tags aren't transpiled at all I guess. |
By the way, I can't reopen this issue. |
@thangngoc89 I'll try with styled-jsx. |
@thangngoc89 I've updated the with-jest example to styled-jsx and it works pretty well. Could you send us a sample repo? |
@arunoda You updated the |
@arunoda I'm following the
|
I'm not sure where to file an issue for this. I have 3 potential places in mind: jest, styled-jsx and next.js
Since the project that I'm working on is a next.js app, I'll start here.
I have
.babelrc
file like thisnext.js version: 2.0.0-beta-19
When I run test with Jest, it throws a syntax error:
The highlighted part is this line
import _JSXStyle from "styled-jsx/style
If I remove
next/babel
preset, jest runs tests just fine.Since I can't find a way to disable babelrc inheritance, I have to do some weird tricks with my .babelrc file like this:
The text was updated successfully, but these errors were encountered: