-
Notifications
You must be signed in to change notification settings - Fork 27
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
Problem getting jest to work with vue and webpack #27
Comments
I'm using webpack 2.7.0 |
Github repo: |
I'll take a look during the weekend, |
Did you get a chance to look into this issue? |
Hey, I only checked the problem, had no chance to come with a solution, but have you considered to leverage babel config for webpack and using .babelrc ? |
FYI, I just installed vanilla install on Windows per this guide: Unit Testing Vue.js Components with the Official Vue Testing Tools and Jest.
This may not add any value to this issue other than to rattle someone's cage. :) Looking forward to making this work. :) |
I'm submitting a ... (check one with "x")
Current behavior
I npm installed the jest-vue-preprocessor package and the jest snapshot test runs properly on the vue framework; however, the application itself doesn't run. The app uses webpack.
If I change the babelrc presets configuration to
{"modules": false}
, the app runs properly, but the tests fail with the errorSyntaxError: Unexpected token import
.With the babelrc presets configuration to
{"modules": "commonjs"}
, the tests run, but the app doesn't.Expected behavior
I should be able to run the tests as well as the app itself.
Minimal reproduction of the problem with instructions
I run the command
NODE_ENV=test jest --no-cache
Here is the "jest" section of my package.json:
I'm running jest with
--no-cache
option.Here's the babelrc file:
What is the motivation / use case for changing the behavior?
Please tell us about your environment:
Atom editor, webpack package manager
jest-vue-preprocessor 1.0.1
Node version : [ OSX | Linux | Windows ]
Windows 7
Platform: [ OSX | Linux | Windows ]
Windows 7
The text was updated successfully, but these errors were encountered: