Categories
Cryptocurrency Ethereum Mastering Development

Truffle test does nothing but compile work

I just started seeing solidity and truffle. I created a new project with the truffle init command and try this test code to verify the deployment of a contract.

const GreeterContract = artifacts.require("Greeter");

contract("Greeter", (accounts) => {
  describe("deployment", () => {
    it("has been deployed successfully", async () => {
      const greeter = await GreeterContract.deployed();
      assert(greeter, "contract failed to deploy");
    });
  });

But the truffle test command does nothing and the terminal stands still as if waiting for something.
Instead truffle compile command works.

The anomaly occurs on both linux and windows. I also tried other test codes from the net or to write whatever, always the same result. Is it a bug?

Truffle version installed at the moment is the latest, 5.1.44

Leave a Reply

Your email address will not be published. Required fields are marked *