@@ -216,13 +216,36 @@ describe('Truffle Plugin: standard use cases', function() {
216216 } ) ;
217217
218218 // This test errors if the reporter is not re-designated as 'spec' correctly
219- it ( 'gracefully disables eth-gas-reporter' , async function ( ) {
219+ it ( 'disables eth-gas-reporter' , async function ( ) {
220220 truffleConfig . mocha = { reporter : 'eth-gas-reporter' } ;
221221
222222 mock . install ( 'Simple' , 'simple.js' , solcoverConfig ) ;
223223 await plugin ( truffleConfig ) ;
224224 } ) ;
225225
226+ it ( 'disables optimization when truffle-config uses V4 format' , async function ( ) {
227+ solcoverConfig = {
228+ silent : process . env . SILENT ? true : false ,
229+ istanbulReporter : [ 'json-summary' , 'text' ]
230+ } ;
231+
232+ truffleConfig . solc = {
233+ optimizer : { enabled : true , runs : 200 }
234+ } ;
235+
236+ mock . install ( 'Simple' , 'simple.js' , solcoverConfig ) ;
237+ await plugin ( truffleConfig ) ;
238+
239+ const expected = [
240+ {
241+ file : mock . pathToContract ( truffleConfig , 'Simple.sol' ) ,
242+ pct : 100
243+ }
244+ ] ;
245+
246+ verify . lineCoverage ( expected ) ;
247+ } ) ;
248+
226249 // This test tightly coupled to the ganache version in production deps
227250 // "test-files" project solcoverjs includes `client: require('ganache-cli')`
228251 it ( 'config: client' , async function ( ) {
0 commit comments