Skip to content

Commit f0209fe

Browse files
author
Nithin Krishna
authored
back to 100% coverage (#105)
* Updated deprecated package name `openzeppelin-zos` * Added additional test to test tx fail when setMinRebaseTimeIntervalSec is 0
1 parent 67e0c16 commit f0209fe

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

.solcover.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ module.exports = {
1111
testCommand: 'npx truffle test ./test/unit/*.js',
1212
compileCommand: 'npx truffle compile',
1313
skipFiles: ['mocks'],
14-
copyPackages: ['openzeppelin-zos'],
14+
copyPackages: ['openzeppelin-eth'],
1515
};

test/unit/UFragmentsPolicy.js

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -208,10 +208,20 @@ contract('UFragmentsPolicy:setMinRebaseTimeIntervalSec', async function (account
208208
prevInterval = await uFragmentsPolicy.minRebaseTimeIntervalSec.call();
209209
});
210210

211-
it('should setMinRebaseTimeIntervalSec', async function () {
212-
const interval = prevInterval.plus(1);
213-
await uFragmentsPolicy.setMinRebaseTimeIntervalSec(interval);
214-
(await uFragmentsPolicy.minRebaseTimeIntervalSec.call()).should.be.bignumber.eq(interval);
211+
describe('when interval = 0', function () {
212+
it('should fail', async function () {
213+
expect(
214+
await chain.isEthException(uFragmentsPolicy.setMinRebaseTimeIntervalSec(0))
215+
).to.be.true;
216+
});
217+
});
218+
219+
describe('when interval > 0', function () {
220+
it('should setMinRebaseTimeIntervalSec', async function () {
221+
const interval = prevInterval.plus(1);
222+
await uFragmentsPolicy.setMinRebaseTimeIntervalSec(interval);
223+
(await uFragmentsPolicy.minRebaseTimeIntervalSec.call()).should.be.bignumber.eq(interval);
224+
});
215225
});
216226
});
217227

0 commit comments

Comments
 (0)