MintableToken.js 930 B

1234567891011121314151617181920212223242526272829303132333435
  1. 'use strict';
  2. const assertJump = require('./helpers/assertJump');
  3. var MintableToken = artifacts.require('../contracts/Tokens/MintableToken.sol');
  4. contract('Mintable', function(accounts) {
  5. let token;
  6. beforeEach(async function() {
  7. token = await MintableToken.new();
  8. });
  9. it('should start with a totalSupply of 0', async function() {
  10. let totalSupply = await token.totalSupply();
  11. assert.equal(totalSupply, 0);
  12. });
  13. it('should return mintingFinished false after construction', async function() {
  14. let mintingFinished = await token.mintingFinished();
  15. assert.equal(mintingFinished, false);
  16. });
  17. it('should mint a given amount of tokens to a given address', async function() {
  18. await token.mint(accounts[0], 100);
  19. let balance0 = await token.balanceOf(accounts[0]);
  20. assert(balance0, 100);
  21. let totalSupply = await token.totalSupply();
  22. assert(totalSupply, 100);
  23. })
  24. });