Home

Awesome

view on npm npm module downloads Gihub repo dependents Gihub package dependents Node.js CI js-standard-style

This project and documentation are a work in progress.

web-runner

Runs the supplied test suite in a headless browser (Chromium).

$ web-runner [<options>] file ...

Synopsis

Example of an isomorphic test model. This file will run natively without transpilation in both Nodejs and the browser.

import Tom from '@test-runner/tom'
import arrayify from './index.mjs'
import getAssert from 'isomorphic-assert'

const a = await getAssert()
const tom = new Tom('array-back')

tom.test('arrayify()', function () {
  a.deepEqual(arrayify(undefined), [])
  a.deepEqual(arrayify(null), [null])
  a.deepEqual(arrayify(0), [0])
  a.deepEqual(arrayify([1, 2]), [1, 2])
  a.deepEqual(arrayify(new Set([1, 2])), [1, 2])
})

export default tom

Example output.

$ web-runner test.mjs


Start: 2 tests loaded

 ✓ array-back if already array, do nothing
 ✓ array-back arrayify()

Completed in 16ms. Pass: 2, fail: 0, skip: 0.

Install

$ npm install --save-dev web-runner

© 2019-21 Lloyd Brookes <75pound@gmail.com>.