As per the official documentation, assert.rejects
was added since Node v10.0.0.
Also, the node console confirms that:
even though, truffle test
throws this error:
TypeError: assert.rejects is not a function
Because I wrote this snippet in my unit-tests:
await assert.rejects(async () => {
await this.contract.createToken(...info, 1, {from: accounts[0]});
});