[Ethereum] Which network does truffle use for testing

testingtestnetstruffletruffle-test

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?

Best Answer

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.

Related Topic