2.0.5 • Published 8 months ago

jest-matcher-percent-error v2.0.5

Weekly downloads
2
License
MIT
Repository
github
Last release
8 months ago

jest-matcher-percent-error

npm GitHub Workflow Status

This is a simple matcher for Jest that tests whether the actual value matches the expected value, within some specified percent error.

Installation

With npm:

$ npm install --save-dev jest-matcher-percent-error

Usage

To test whether the result of foo() is within 10% of 100:

import toBeWithinPercent from "jest-matcher-percent-error";

expect.extend({ toBeWithinPercent });

test("foo works", () => {
  expect(foo()).toBeWithinPercent(100, 10);
});

License

This is free software, distributed under the MIT license.

2.0.5

8 months ago

2.0.4

1 year ago

2.0.3

2 years ago

2.0.2

2 years ago

2.0.1

2 years ago

2.0.0

2 years ago

1.1.2

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.1

6 years ago

1.0.0

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago