ERC20Capped.test.js 684 B

1234567891011121314151617181920212223
  1. const { ether, expectRevert } = require('@openzeppelin/test-helpers');
  2. const { shouldBehaveLikeERC20Capped } = require('./ERC20Capped.behavior');
  3. const ERC20Capped = artifacts.require('$ERC20Capped');
  4. contract('ERC20Capped', function (accounts) {
  5. const cap = ether('1000');
  6. const name = 'My Token';
  7. const symbol = 'MTKN';
  8. it('requires a non-zero cap', async function () {
  9. await expectRevert(ERC20Capped.new(name, symbol, 0), 'ERC20Capped: cap is 0');
  10. });
  11. context('once deployed', async function () {
  12. beforeEach(async function () {
  13. this.token = await ERC20Capped.new(name, symbol, cap);
  14. });
  15. shouldBehaveLikeERC20Capped(accounts, cap);
  16. });
  17. });