Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions plugins/resources/truffle.utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,12 @@ function normalizeConfig(config){
config.testDir = config.test_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;
}

Expand Down
8 changes: 8 additions & 0 deletions test/units/truffle/standard.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
// "test-files" project solcoverjs includes `client: require('ganache-cli')`
it('config: client', async function(){
Expand Down