[Ethereum] How to run truffle tests on testnet

testnetstruffle

My truffle tests use several accounts and send tokens between them, so how would I run such a truffle test on testnet, e.g. Rinkeby?

Best Answer

The procedure is the same like testing locally with a dev node or ganache/testrpc.

Basically, you will have to setup a local node synced with Rinkeby. Moreover, you'll have to create as many account as you need for your tests and load them with some ether, if they're going to create transactions.

In truffle.js you can also specify different networks. Using the --network <NETWORKNAME> parameter, you can switch between them. E.g. truffle test --network rinkeby.

Related Topic