1

The following call

filestore.getBlockNumber.q(fileHash).should.eventually.bignumber.equal(blockNumber)

Fails with

AssertionError: expected { state: 'pending' } to be an instance of string, number or BigNumber
A F
  • 7,424
  • 8
  • 40
  • 52

1 Answers1

3

I can reproduce the issue, and also fix it by changing the order in which the plugins are used:

chai.use(require('chai-bignumber'));
chai.use(require('chai-as-promised'));
robertklep
  • 198,204
  • 35
  • 394
  • 381
  • 1
    This is also described in [this issue](https://github.com/domenic/chai-as-promised/issues/244) and those referenced from there, in short: `use` chai-as-promised last and only *once*. If in doubt, refactor that stuff into an external file [just like `chai-as-promised` does](https://github.com/domenic/chai-as-promised/blob/master/test/support/setup.js) and [recommends](https://github.com/domenic/chai-as-promised#installation-and-setup). – tjanson Sep 24 '18 at 21:03