![]() ![]() ![]() I can tell you that even with the -inspect-brk and -runInBand settings and running Chrome’s debugger with chrome://inspect, I can’t get the react-scripts commands from “Create React App” to stop on a breakpoint lately.With React Native you can develop native mobile applications for iOS and Android using JavaScript and React. This is what makes it possible to break on the debugger line. -runInBand – forces the test runner to run a test at a time, so that they run in the same Node process.Likely the JetBrains Jest plugin intercepts this and launches tests in the right order. -inspect-brk=62420 – kicks off the debugger and pauses immediately.reporters \"/mnt/c/Program Files/JetBrains/WebStorm 2018.3.1/plugins/JavaScriptLanguage/helpers/jest-intellij/lib/jest-intellij-reporter.js\" -verbose require \"/mnt/c/Program Files/JetBrains/WebStorm 2018.3.1/plugins/JavaScriptLanguage/helpers/jest-intellij/lib/jest-intellij-stdin-fix.js\" /mnt/c/Users/kenri/projects/Training/react-fundamentals-training/labs/words/node_modules/react-scripts/scripts/test.js home/krimple/.nvm/versions/node/v11.4.0/bin/node The key here is that they add -runInBand and also properly launch the with the right debugging configuration settings. I’ve tried setting several breakpoints in different files, and it seems to always work. ![]() Once you create your launch configuration, just click the debug icon. However, IntelliJ seems to have licked this with the Jest plugin. There are some maddening problems with getting Jest to stop when running in a debugger from the command line. It will then only run that directory’s tests and below. Just add the directory name to the Jest Options setting in the Jest Runner. Want to run a set of tests by a unique directory name? Easy. Or just use TypeScript… Run Tests by File Path If you add the following to your package.json file, you’ll have a lot of useful info in the IDE: The WebStorm IDE uses TypeScript types to inspect and provide code fill-in (intellisense) support at development time. Get Intellisense Support for React, Jest, and other APIs Remove the configuration file setting from the test setup dialog. The problem here is that the parameter for the setupTests.js injection is already done within the react scripts test runner, and so it seems to confuse the test runner.Įasy fix. Then it tells it to use the config settings in our src/setupTests.js file. TL DR: turns out the JetBrains Jest plugin gets executed, which runs the react-scripts/test.js script, and it passes it a custom Jest reporter. If you read all of that, congratulations. colors -reporters \"/mnt/c/Program Files/JetBrains/WebStorm 2018.3.1/plugins/JavaScriptLanguage/helpers/jest-intellij/lib/jest-intellij-reporter.js\" config /mnt/c/Users/kenri/projects/Training/react-fundamentals-training/labs/words/src/setupTests.js 08-forms-solution mnt/c/Users/kenri/projects/Training/react-fundamentals-training/labs/words/node_modules/react-scripts/scripts/test.js JavaScriptLanguage/helpers/jest-intellij/lib/jest-intellij-stdin-fix.js\" \"/mnt/c/Program Files/JetBrains/WebStorm 2018.3.1/plugins home/krimple/.nvm/versions/node/v11.4.0/bin/node -require For giggles, go ahead and click on the yellow command invocation and see it’s really trying to run:Įxport PATH=/home/krimple/.nvm/versions/node/v11.4.0/bin:$PATH
0 Comments
Leave a Reply. |