@@ -275,5 +275,34 @@ describe('Truffle Plugin: command line options', function() {
275
275
assert . deepEqual ( producedMatrix , expectedMatrix ) ;
276
276
process . env . TRUFFLE_TEST = false ;
277
277
} ) ;
278
+
279
+ it ( '--abi' , async function ( ) {
280
+ const expected = [
281
+ {
282
+ "contractName" : "Migrations" ,
283
+ "humanReadableAbiList" : [
284
+ "function last_completed_migration() view returns (uint256)" ,
285
+ "function owner() view returns (address)" ,
286
+ "function setCompleted(uint256) nonpayable" ,
287
+ "function upgrade(address) nonpayable"
288
+ ]
289
+ } ,
290
+ {
291
+ "contractName" : "Simple" ,
292
+ "humanReadableAbiList" : [
293
+ "function getX() view returns (uint256)" ,
294
+ "function test(uint256) nonpayable"
295
+ ]
296
+ }
297
+ ] ;
298
+
299
+ truffleConfig . abi = true ;
300
+ mock . install ( 'Simple' , 'simple.js' , solcoverConfig ) ;
301
+ await plugin ( truffleConfig ) ;
302
+
303
+ const outputPath = path . join ( process . cwd ( ) , mock . pathToTemp ( './humanReadableAbis.json' ) ) ;
304
+ const output = require ( outputPath ) ;
305
+ assert . deepEqual ( output , expected ) ;
306
+ } )
278
307
} ) ;
279
308
0 commit comments