Option 2: run entirely in Node.
Tests run faster and use less memory when they don't need a browser.
This works best for testing code that isn't tied to the DOM (such as parsing text or transforming JSON scenegraphs).
Unlike Option 1, this doesn't require a human to run the test, so other actions could be chained (such as releasing a new version of a library, or sending an alert that the build is broken).
The other options:
First, install Node.
Then install the project dependencies:
npm install
Then run the test
script (it runs the command defined in package.json):
npm test
The file /.github/worksflows/tests.yml
signals Github to re-run the tests
when new code is available, using Github Actions.
The results are displayed in the tab Actions
of the repository.
Depending on your settings, you would also receive a notification
with a direct link to the results after a test has run.
The .vscode
folder is optional: it merely defines the path to the tests
and recommends a few matching extensions.
This way, you could run specific tests on their own in the debugger, using Tests Explorer, and get direct feedback in the editor.