Add tests to extend code coverage (#2586)

This commit is contained in:
Hadrien Croubois
2021-03-15 17:01:47 +01:00
committed by GitHub
parent d5194725b7
commit cd443f0d5b
8 changed files with 91 additions and 11 deletions

View File

@ -11,6 +11,12 @@ contract('ReentrancyGuard', function (accounts) {
expect(await this.reentrancyMock.counter()).to.be.bignumber.equal('0');
});
it('nonReentrant function can be called', async function () {
expect(await this.reentrancyMock.counter()).to.be.bignumber.equal('0');
await this.reentrancyMock.callback();
expect(await this.reentrancyMock.counter()).to.be.bignumber.equal('1');
});
it('does not allow remote callback', async function () {
const attacker = await ReentrancyAttack.new();
await expectRevert(