6.0.4 • Published 6 months ago

beartest-js v6.0.4

Weekly downloads
97
License
MIT
Repository
github
Last release
6 months ago

Beartest is an extremely simple JavaScript test runner inspired by Baretest, Playwright, and Jest. It has a tiny footprint while maintaining a familiar API.

Install

npm install --save-dev beartest-js
yarn add beartest-js -D

Why Beartest?

Jest, Mocha, and similar testing frameworks are richly featured, broadly compatible, and highly customizable. Beartest is none of those things. If you want features look somewhere else. Beartest is meant to be simple and understandable, without the complexity of other testing frameworks. Inspired by Baretest, it seeks to deliver an API similar to Jest's with minimal code.

Compatibility

The Beartest test runner uses common js to load files.

Usage

Beartest implements the following functions describe, it, beforeAll, beforeEach, afterEach, afterAll, it.skip, and it.only. All provided functions work in a similar way as the corresponding functions in Jest.

Example

import { test } from "beartest-js";
import assert from "assert";

test.describe("Math Testing", () => {
  test("should add correctly", async () => {
    assert.strictEqual(1 + 2, 3);
  });

  test("should subtract correctly", async () => {
    assert.strictEqual(3 - 2, 1);
  });
});

Running Tests

Additionally, a very basic test runner is included. This test runner accepts a glob pattern as a command line argument. The test runner can be invoked with yarn beartest "glob-pattern". By default, it will look for **/*.test.js.

Suggested package script:

  "scripts": {
    "test": "beartest"
  }

License

Licensed under MIT.

6.0.1

6 months ago

6.0.0

6 months ago

6.0.3

6 months ago

6.0.2

6 months ago

6.0.4

6 months ago

5.0.4

2 years ago

5.0.3

2 years ago

5.0.2

2 years ago

5.0.1

2 years ago

5.0.0

2 years ago

4.0.0

3 years ago

3.1.1

3 years ago

3.1.0

3 years ago

3.0.0

3 years ago

2.0.3

3 years ago

2.0.2

3 years ago

1.0.1

3 years ago

2.0.1

3 years ago

2.0.0

3 years ago

1.0.0

3 years ago