Skip to content

Adds a bnEqual method to chai that compares the string version of the BN to a string version of its input.

Notifications You must be signed in to change notification settings

transmissions11/chai-bn-equal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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:

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);
  });
});

About

Adds a bnEqual method to chai that compares the string version of the BN to a string version of its input.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published