I am trying to test my contract with Mocha. So far, my solution has been this:
it("transfers token ownership", async () => {
const tokenInstance = await DappToken.deployed()
expect(async () => { await tokenInstance.transfer(accounts[1], 9999999999999999999) }).to.throw('user has insufficient funds');
})
But I get this error:
AssertionError: expected [Function] to throw an error
Any idea how to fix? Thanks!