I'm trying to run some test cases in Travis CI using truffle but I want some of them not to run if the test environment(localhost:8545) is running via "testrpc" because some of my test cases only work with geth, not with testrpc.
If somehow I know the test environment while running test cases, I can skip test cases using "if condition in code" as per Mocha JS documentation -
it('should only test in the correct environment', function() {
if (/* check test environment */) {
// make assertions
} else {
this.skip();
}
});
my turffle.js looks like this -
networks: {
development: {
host: 'localhost',
port: 8545,
network_id: '*' // Match any network id
},
geth: {
host: 'some ec2 url',
port: 8545,
network_id: '*',
gasPrice: 20e9,
gas: 0xfffffff,
}
}
development environment is running on testrpc(localhost) and geth environment is talking to a geth node on an EC2 instance.
In test case, if detected environment is development then only my test cases should run, otherwise not. So can someone help me that how do I find the truffle environment while running testcases?