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", () => {
it("has been deployed successfully", async () => {
const greeter = await GreeterContract.deployed();
assert(greeter, "contract was not deployed");
});
});
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
EDIT
This is the folder structure created by truffle init
.The Greeter contract is missing to fail the test. However, I also tried to add it and nothing changes.
test
folder. NOTE: Your example is missing a trailing curly brace.greeter.test.js
?greeter.test.js
. I'm starting to think it's a problem on Ubuntu, Windows 10 and also with WSL2 because, not knowing what to do anymore, I try it on a PC with Fedora 32 and it works. It is really weird. It is as if it does not understand thetest
command because if I write something wrong, liketesst
I have the same problem, the terminal is waiting