-
-
Notifications
You must be signed in to change notification settings - Fork 158
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
Jest - Debug usage with WebStorm #5
Comments
Oh that's interesting. We use a similar approach to Create React App. Do you have any experience with using WebStorm with Create React App? |
I don't, but looking at my code I see I use react-app-rewired, which does also something quite similar, see: |
If they are doing something similar then it might be related to this issue - #4. Maybe all the arguments are not being passed in. Once we fix that, let's give this a try again. |
any progress on this? running tests with |
@patrykkrawczyk Not right now. I'm not a WebStorm user, so I need some help with this. |
@Vadorequest, @patrykkrawczyk: The way I worked around this was to:
// jest.config.js
const path = require('path');
const createJestConfig = require('serverless-bundle/scripts/config/createJestConfig');
const relativePath = (relativePath) => path.resolve(__dirname, 'node_modules/serverless-bundle', relativePath);
module.exports = createJestConfig(relativePath, __dirname);
That seemed to do the trick for me. |
Thanks @markisadesignerd - that worked for me in IntelliJ I had to remove "type": "module" from my package.json but I can live with that. Also I am pointed to my project's node_modules/jest folder. |
@markisadesignerd Thank you for this! I'll link to this in the README. |
This works fine but I have a problem with debugging not stepping over (only stops on break-points). Any lights? |
Webstorm natively supports debugging tests (single test, multiple tests, whole file) with jest. But since this plugin requires to invoke tests using
serverless-bundle
script, it's somewhat incompatible with WebStorm's native way of running tests and results with "Jest encountered an unexpected token" because it can't understand ES6 import/export (it's not running jest through webpack/babel)What's the recommended way to configure WebStorm with serverless-bundle? Or is there any known workaround? (I believe it's possible to configure webstorm to run tests through serverless-bundle, but haven't figured out how yet)
The text was updated successfully, but these errors were encountered: