https://github.com/transmissions11/chai-bn-equal
Adds a bnEqual method to chai that compares the string version of the BN to a string version of its input.
https://github.com/transmissions11/chai-bn-equal
Last synced: about 1 year ago
JSON representation
Adds a bnEqual method to chai that compares the string version of the BN to a string version of its input.
- Host: GitHub
- URL: https://github.com/transmissions11/chai-bn-equal
- Owner: transmissions11
- Created: 2020-12-23T18:53:11.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2021-01-10T19:41:06.000Z (over 5 years ago)
- Last Synced: 2025-03-17T13:52:25.954Z (over 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 1000 Bytes
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# chai-bn-equal
Adds a `bnEqual` method to chai that compares the string version of the BN to a string version of its input.
#### Pairs well with `chai-as-promised`!
## Installation:
`npm i --save-dev chai-bn-equal`
## Example:
```js
const chai = require("chai");
const chaiAsPromised = require("chai-as-promised");
const chaiBnEqual = require("chai-bn-equal");
const BN = require("bn.js");
chai.use(chaiBnEqual);
chai.use(chaiAsPromised);
chai.should();
describe("chai-bn-equal", () => {
it("should pass", () => {
return Promise.resolve(new BN("2")).should.eventually.bnEqual(2);
});
});
```