Skip to content

Latest commit

 

History

History
41 lines (29 loc) · 1.47 KB

TESTING.md

File metadata and controls

41 lines (29 loc) · 1.47 KB

Testing the extension

The extension features a number of unit tests written in Jasmine. There are a few steps necessary to run them.

You will need

Running the tests

The tests are designed to be run with Chrome, either headless (as they run on GitHub actions) or otherwise. They are launched using the Karma test runner, which can be installed using npm.

  1. Install Node and npm.
  2. In the project directory, npm install
  3. (optional) npm install -g karma-cli. If you don't, replace karma with node_modules/.bin/karma in the step below.
  4. Finally, karma start or karma start --browsers Chrome_CI for headless.

All of the necessary node packages are installed in the project folder in the node_modules directory (which is part of .gitignore).

Running once

By default, karma runs in an 'iterative' mode, where it watches input files and editing test or source code instantly causes the test suite to be re-run. If you'd like to only do a single pass of the test suite, pass karma the flag --single-run.

Adding additional browsers/launchers

It shouldn't be too hard to add additional browsers/launchers. Simply:

  1. npm install --save-dev karma-somebrowser-launcher
  2. Add the new launcher to the plugins section of karma.conf.js
  3. Run karma start --browsers SomeBrowser