ERC20Capped.test.js 810 B

1234567891011121314151617181920212223242526
  1. const { accounts, contract } = require('@openzeppelin/test-environment');
  2. const { BN, ether, expectRevert } = require('@openzeppelin/test-helpers');
  3. const { shouldBehaveLikeERC20Capped } = require('./behaviors/ERC20Capped.behavior');
  4. const ERC20Capped = contract.fromArtifact('ERC20CappedMock');
  5. describe('ERC20Capped', function () {
  6. const [ minter, ...otherAccounts ] = accounts;
  7. const cap = ether('1000');
  8. it('requires a non-zero cap', async function () {
  9. await expectRevert(
  10. ERC20Capped.new(new BN(0), { from: minter }), 'ERC20Capped: cap is 0'
  11. );
  12. });
  13. context('once deployed', async function () {
  14. beforeEach(async function () {
  15. this.token = await ERC20Capped.new(cap, { from: minter });
  16. });
  17. shouldBehaveLikeERC20Capped(minter, otherAccounts, cap);
  18. });
  19. });