New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

beater

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

beater

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

9.0.1
latest
Source
npm
Version published
Weekly downloads
23
43.75%
Maintainers
1
Weekly downloads
 
Created
Source

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

Badges

npm version Travis CI

License

MIT

Author

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

Keywords

beater

FAQs

Package last updated on 11 Apr 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts