0

I am probably doing something wrong but can't see what exactly.

Code:

pragma solidity ^0.5.8;

import "truffle/Assert.sol";

contract TestABC {
    function totalSupplyTest() public {
        bool a = true;
        bool b = true;
        Assert.equal(a, b, "message ABC");
    }
}

Command:

$ truffle test

Result:

Using network 'development'.


Compiling your contracts...
===========================
> Compiling ./test/TestABC.sol



  0 passing (3ms)

The expected output should say:

1 passing (... ms)

2

As you can read in the docs:

Like test contract names, all test functions must start with test, lowercase.

pragma solidity ^0.5.8;

import "truffle/Assert.sol";

contract TestABC {
    function testTotalSupplyTest() public {
        bool a = true;
        bool b = true;
        Assert.equal(a, b, "message ABC");
    }
}

Output:

$ truffle test
Using network 'development'.

Compiling your contracts...
===========================
> Compiling ./test/TestABC.sol
> Artifacts written to /tmp/test-119105-5627-di9xqz.t2n2p
> Compiled successfully using:
   - solc: 0.5.8+commit.23d335f2.Emscripten.clang

  TestABC
    ✓ testTotalSupplyTest (71ms)

  1 passing (9s)
| improve this answer | |

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.