Skip to content

Instantly share code, notes, and snippets.

@kitsonk
Last active August 8, 2017 09:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kitsonk/11c66976858c2f0f54e92b42c42dd0bc to your computer and use it in GitHub Desktop.
Save kitsonk/11c66976858c2f0f54e92b42c42dd0bc to your computer and use it in GitHub Desktop.
Working with Intern 3 from vscode

Work with Intern from vscode

This document provides an example of how you can configure vscode to test with Intern.

You will need to edit your .vscode/launch.json in the root of your project and follow the example JSON below.

This will provide two "tasks", both being the unit tests, in Node.js and Chrome. The latter needs the Chrome Debugger plugin installed in vscode. You need to tailor the below to match you environment and assumes that intern is installed in the root of node_modules and that you are serving your project root up at localhost:8080.

There is more documentation of the launch.json at Debugging, including if you have a build step that you want to run before launching the debugger.

You should be able to set breakpoints and step through your tests and code.

{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Test (unit in NodeJS)",
"program": "${workspaceRoot}/node_modules/.bin/intern-client",
"args": [
"reporters=${workspaceRoot}/support/intern/Reporter",
"config=dev/tests/intern",
"excludeInstrumentation=."
]
}, {
"type": "chrome",
"request": "launch",
"name": "Test (unit in Chrome)",
"url": "http://localhost:8080/node_modules/intern/client.html?config=dev/tests/intern",
"webRoot": "${workspaceRoot}"
}
]
}
@CodeTroopers
Copy link

For Intern 4, you can find a configuration example here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment