WebStorm version 2018.3 and newer Click the + button in the Arguments field to insert a macro. Change this setting later to debug a different file. WebStorm version prior to 2018.3 Specify the path to the test file you wish to debug in the Arguments field. Like so: suitest interactive -inspect-brk=9121. Select the npm script ( debug) in the Scripts field. Instead, reference JavaScript file from the package source. For example, on Windows NPM would wrap any executables into CMDįile, so passing node_modules/.bin/ will cause syntax error. When debugging, make sure to pass the Node.js script to the Test Launcher and Fill it in with the following: /node_modules/suitest-js-api/lib/testLauncher/index.js", Debugging in Visual Studio Code ¶Ĭreate Node.js run configuration (configurations array in launch.jsonĭebugger configuration file). Menu and selecting newly created configuration in the popup. You can launch the built-in IDE debugger by selecting Run > Debug in main To Node parameters field and adjust Application parameters field inspect-brk= (it will be used for main Suitest process) If you need debugger to be on some exact port, you need to add node_modules/mocha/bin/_mocha -no-timeouts -exit. Where is a Node.js script you want to debug. node_modules/suitest-js-api/lib/testLauncher/index.jsĪpplication parameters to interactive node , Working directory to root folder of your project (where your Click inspect to open Chrome Developer Tools attached to yourĭebugging in JetBrains IDE (WebStorm, PhpStorm, IntelliJ IDEA etc.) ¶Ĭreate Node.js run configuration. In Chrome you should now see your Node process under Remote Target Supercharge your debugging experience for Node.js What do you do when you see this Debugging server-side javascript code with console logs is archaic. node_modules/mocha/bin/_mocha -no-timeouts Is one of the ports, configured in previous step. Make sure you passĮither -inspect= or -inspect-brk= parameter, where Start your Node.js script with Suitest Test Launcher. Set up ports that Chrome Developer Tools should be listening to. button next to Discover network targets option to Make sure thatĭiscover network targets checkbox is checked. In Chrome browser open chrome://inspect/#devices page. inspect= and -inspect-brk= Node.js debugging options. Step-by-step and see how the device reacts to each command. The main reason why you would want to enable debugging of your tests is thatīy setting pauses (breakpoints) you will be able to follow your test execution Started with the Test Launcher in interactive mode. This section covers how to enable debugging for a Node.js application that is If you are new to Suitest JavaScript API, please use the version 3 instead. This part of user documentation is describing an obsolete version 2.5.* (or older) of Suitest JavaScript API and is meant only for users who have not yet switched to the version 3.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |