I have this simple test in truffle:

it("should emit the correct Transfer event", async function() {
    await this.contractNFT.multiSafeMint(accounts[0], "CID/metadata.json", 3, {from: accounts[0]});
    const receipt = await this.contractNFT.multiSafeTransfer(accounts[1], [0, 1, 2], {from: accounts[0]});

    expectEvent(receipt, "MultiSafeTransfer", {
        from: accounts[0],
        to: accounts[1],
        tokenIds: [new BN(0), new BN(1), new BN(2)]

but when I run the test I get this error from the console:

expected event argument 'tokenIds' to have value 0,1,2 but got 0,1,2
+ expected - actual

I'm using BN from @openzeppelin/test-helpers, I also tried with BN from web3-utils.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.