I have a network 'foo' that is configured inside truffle.js. Running my tests works just fine

truffle test --network foo ./test/*.js

then I realized I forgot to start 'foo'. To confirm this running the console fails.

truffle console --network foo

How is it that my tests can pass even saying Using network 'foo' while the network is not running?

What am I missing here?

  • What do you mean forgot to start 'foo'? How exactly are you "starting foo"? – goodvibration May 6 '19 at 12:05
  • I forgot starting geth. – tcurdt May 6 '19 at 12:50
  • In your truffle configuration file, what are your host and port settings for the foo network? – goodvibration May 6 '19 at 13:12
  • and 8545 but the problem is that truffle test works - not that truffle console doesn't. – tcurdt May 6 '19 at 15:12
  • When I start geth connecting the with truffle console works just as expected. – tcurdt May 6 '19 at 15:14

Turns out truffle test automatically starts a ganache instance if there is no test network. See the github issue. The truffle test --network foo seems to fall back to the default instance if the network foo is down.

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.