@@ -289,5 +289,34 @@ describe('Truffle Plugin: command line options', function() {
289
289
assert . deepEqual ( producedMatrix , expectedMatrix ) ;
290
290
process . env . TRUFFLE_TEST = false ;
291
291
} ) ;
292
+
293
+ it ( '--abi' , async function ( ) {
294
+ const expected = [
295
+ {
296
+ "contractName" : "Migrations" ,
297
+ "humanReadableAbiList" : [
298
+ "function last_completed_migration() view returns (uint256)" ,
299
+ "function owner() view returns (address)" ,
300
+ "function setCompleted(uint256) nonpayable" ,
301
+ "function upgrade(address) nonpayable"
302
+ ]
303
+ } ,
304
+ {
305
+ "contractName" : "Simple" ,
306
+ "humanReadableAbiList" : [
307
+ "function getX() view returns (uint256)" ,
308
+ "function test(uint256) nonpayable"
309
+ ]
310
+ }
311
+ ] ;
312
+
313
+ truffleConfig . abi = true ;
314
+ mock . install ( 'Simple' , 'simple.js' , solcoverConfig ) ;
315
+ await plugin ( truffleConfig ) ;
316
+
317
+ const outputPath = path . join ( process . cwd ( ) , mock . pathToTemp ( './humanReadableAbis.json' ) ) ;
318
+ const output = require ( outputPath ) ;
319
+ assert . deepEqual ( output , expected ) ;
320
+ } )
292
321
} ) ;
293
322
0 commit comments