I'm learning solidity with a course but I'm stuck with an error.
My version of Chai :
"chai": "^4.3.6",
"chai-as-promised": "^7.1.1",
"chai-bignumber": "^3.0.0",
The way I use it in my code :
require('chai').use(require('chai-as-promised')).should()
And I'm stuck wit this part of my code :
describe('failure', async () => {
it( 'rejects insuffisants Tokens', async () => {
let invalidAmount;
invalidAmount = tokens(1000000);
await token.transfer(receiver, invalidAmount, {from: deployer}).should.be.rejectedWith(EVM_REVERT)
})
})
This line await token.transfer(receiver, invalidAmount, {from: deployer}).should.be.rejectedWith(EVM_REVERT)
throw me an error.
EVM_REVERT is a const with the value 'VM Exception while processing transaction: revert'
As you can see even my IDE is not happy with rejectedWith :
When I launch Truffle test, I've got this error :
AssertionError: expected promise to be rejected with an error including 'VM Exception while processing transac…' but it was fulfilled with { …(3) }
Any idea ?