0

I am trying to run a test and I am getting the following message;

enter image description here

I have tried the following;

npm install scrypt

npm install web3

as to solve the yellow message and when running truffle test truffle get's stuck and no test are shown...

This is the test code;

var TtdmToken = artifacts.require("./TtdmToken.sol");

contract('TtdmToken', function(accounts) {

    it'sets the total supply upon deployment', function() {
    return TtdmToken.deployed().then()function(instance) {
    tokenInstance.totalSupply();
    }).then(function(totalSupply) {
        assert.equal(totalSupply.toNumber(), 100000,'sets the total supply to 1,000,000');
    });
  });
})

What might be causing the issue as it gets stuck with truffle test but other commands works but the yellow message keeps on showing...

  • Are you running ganache-cli concurrently? – goodvibration Jan 15 at 4:24
  • Yes it is, and I made sure to create different workplaces to help better to track the issues. – Lucas Jan 15 at 19:43
0

Looks like you have some syntax errors (also that test is checking the total supply, not setting it), please try the following:

contract('TtdmToken', (accounts) => {
  it('Checks whether or not the total supply is equal to 1,000,000', () =>
    TtdmToken.deployed()
    .then(tokenInstance => tokenInstance.totalSupply())
    .then((totalSupply) => {
      assert.equal(
        totalSupply.toNumber(),
        1000000,
        'Total supply was not equal to 1,000,000'
      );
    })
  );
})
  • That does not explain the truffle get's stuck and no test are shown part though. – goodvibration Jan 15 at 11:25
  • The first that came in mind as it is not loading the tests so I though it might be related... – Lucas Jan 15 at 19:44
  • Thanks for the coding suggestions, but the test still not going through, it kind of freezes until I ctrl-z. I – Lucas Jan 15 at 19:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.