パッケージの詳細

beater

bouzuya43MIT9.0.1

beater: bouzuya's easy test runner. it is inspired by eater.

beater, bouzuya, eater, runner

readme

beater logo

beater: bouzuya's easy test runner. beater is inspired by eater.

Features

  • Only 2 functions:
    • run()
    • runWithOptions()
  • You can use your favorite assert().
  • You can use your favorite reporter.
  • You can use TypeScript (3.x *.d.ts is included).

Usage

1. Install

$ npm install --save-dev beater

2. Write test

// test/index.js
const assert = require('assert');
const { run } = require('beater');

const test1 = function simple_test() {
  assert(1 === 1);
};

const test2 = function promise_test() {
  return new Promise((resolve) => {
    assert(1 === 1);
    resolve();
  });
};

const test3 = async function async_fn_test() {
  await new Promise((resolve) => setTimeout(resolve, 0));
  assert(1 === 1);
};

run([test1, test2, test3]).catch(() => process.exit(1));

3. Run

$ node test/index.js
TAP version 13
1..3
ok 1 - simple_test
ok 2 - promise_test
ok 3 - async_fn_test

Related Packages

Badges

npm version Travis CI

License

MIT

Author

bouzuya <m@bouzuya.net> (https://bouzuya.net/)

更新履歴

9.0.1 (2020-04-11)

  • build(deps): update dependencies
  • build(deps-dev): update devDependencies

9.0.0 (2020-02-01)

  • Bump eslint-config-prettier from 6.9.0 to 6.10.0 (7ee3e2d)
  • Bump sinon from 8.0.4 to 8.1.0 (1affec4)
  • Bump typescript from 3.7.4 to 3.7.5 (a8fe209)
  • refactor!: drop support for node.js v8 (02564a4)
  • build: add eslint and prettier (80d3b07)
  • build: bump sinon from 8.0.1 to 8.1.1 (5bb1f3c)
  • build: stop searching for other eslint configs (1d9d266)
  • build(deps-dev): bump @typescript-eslint 2.17.0 to 2.18.0 (482617c)
  • build(deps-dev): bump babel from 7.8.3 to 7.8.4 (f476a4c)
  • build(deps-dev): update devDependencies (7d6464b)
  • build(deps): update dependencies (945b342)
  • refactor: apply eslint (573cbae)
  • style: apply prettier (a57d6bf)

BREAKING CHANGE

  • drop support for node.js v8

8.0.2 (2020-01-16)

8.0.0 (2019-12-08)

7.0.0 (2019-11-28)

6.0.2 (2019-11-16)

6.0.1 (2019-05-02)

6.0.0 (2019-05-02)

5.0.1 (2017-08-04)

5.0.0 (2017-07-15)

0.4.0 (2016-06-16)

0.3.0 (2016-06-08)

0.2.0 (2016-06-06)

0.1.3 (2016-06-06)

0.1.2 (2016-06-05)

0.1.1 (2016-06-05)

0.1.0 (2016-06-05)