Gracefully overwrite eth-gas-reporter (#448)

pull/449/head
cgewecke 5 years ago committed by GitHub
parent f2cdb63498
commit d9af5ac571
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      plugins/resources/truffle.utils.js
  2. 8
      test/units/truffle/standard.js

@ -194,6 +194,12 @@ function normalizeConfig(config){
config.testDir = config.test_directory; config.testDir = config.test_directory;
config.artifactsDir = config.build_directory; config.artifactsDir = config.build_directory;
// eth-gas-reporter freezes the in-process client because it uses sync calls
if (typeof config.mocha === "object" && config.mocha.reporter === 'eth-gas-reporter'){
config.mocha.reporter = 'spec';
delete config.mocha.reporterOptions;
}
return config; return config;
} }

@ -215,6 +215,14 @@ describe('Truffle Plugin: standard use cases', function() {
); );
}); });
// This test errors if the reporter is not re-designated as 'spec' correctly
it('gracefully disables eth-gas-reporter', async function(){
truffleConfig.mocha = { reporter: 'eth-gas-reporter' };
mock.install('Simple', 'simple.js', solcoverConfig);
await plugin(truffleConfig);
});
// This test tightly coupled to the ganache version in production deps // This test tightly coupled to the ganache version in production deps
// "test-files" project solcoverjs includes `client: require('ganache-cli')` // "test-files" project solcoverjs includes `client: require('ganache-cli')`
it('config: client', async function(){ it('config: client', async function(){

Loading…
Cancel
Save