OpenZeppelin Test Helpers 0.5

I :heart: the Test Helpers. (I am biased :smile:).

I upgraded my tests for https://github.com/abcoathup/Simple777Token and got the following error which had me stumped. Similar tests worked on https://github.com/OpenZeppelin/openzeppelin-contracts.

TypeError: this.erc1820.setInterfaceImplementer is not a function

I had forgotten that migrations were run as part of truffle test (even though in my tests I create new contract instances in beforeEach).

As per how to upgrade from 0.4 I needed to change in my migrations (2_deploy.js)

require('@openzeppelin/test-helpers/configure')({ web3 });

to

require('@openzeppelin/test-helpers/configure')({ provider: web3.currentProvider, environment: 'truffle' });
1 Like