@chialab/rna-browser-test-runner
v0.18.0
Published
A test runner for browsers based on Web Test Runner.
Downloads
309
Readme
Install
npm i @chialab/rna-browser-test-runner -D
yarn add @chialab/rna-browser-test-runner -D
Usage
Start a browser test runner based on the web dev server. It uses mocha but you still need to import an assertion library (recommended @open-wc/testing
).
Via import
import { test } from '@chialab/rna-browser-test-runner';
/**
* @see https://modern-web.dev/docs/test-runner/cli-and-configuration/
*/
await test({
// files: ['...'],
});
Via cli
test:browser [options] [specs...]
Options:
-P, --port dev server port
--watch watch test files
--concurrency <number> number of concurrent browsers
--coverage add coverage to tests
--manual manual test mode
--open open the browser
--saucelabs [browsers...] run tests using Saucelabs browsers
-h, --help display help for command
Samples
rna test:browser
rna test:browser 'test/**/*.spec.js' --coverage
rna test:browser 'test/elements.spec.js' --watch --open
License
RNA Browser Test Runner is released under the MIT license.