Debugging Skill Code

If you specify --wait-for-attach, then the local run will expose a debugging session that you can attach one of several Node.js debugging clients to, including popular JavaScript editors like Visual Studio Code and JetBrains’ WebStorm. You can even attach Google Chrome’s DevTools to the session and use the debugger in the browser to step through the code. How you do this will vary depending on which debugging client you are using, but the Node.js Debugging Guide[44] has instructions for several of them.

If you’re using Visual Studio Code, it’s very easy to attach a debugging session. All you need to do is open the “Run and Debug” view from the Activity Bar, then click the “JavaScript Debug Terminal” button to open a terminal window. From that terminal window, running ask run will run the skill locally and attach the Visual Studio Code debugger. The screenshot highlights the relevant portions of Visual Studio Code for running the debugger.

images/test/vscode-debugger.png

Now you can test your skill the same as if you had fired up ask run from the command line. But you can also set breakpoints in the code and step through the code.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset