@@ -27,10 +27,20 @@ import { HookManagerImplementation } from "../../../../../src/internal/core/hook
27
27
28
28
async function emitArtifacts ( solidity : SolidityBuildSystem ) : Promise < void > {
29
29
const rootFilePaths = await solidity . getRootFilePaths ( ) ;
30
- const compilationJobs = await solidity . getCompilationJobs ( rootFilePaths , {
31
- isolated : false ,
32
- quiet : true ,
33
- } ) ;
30
+ const compilationJobsResult = await solidity . getCompilationJobs (
31
+ rootFilePaths ,
32
+ {
33
+ isolated : false ,
34
+ quiet : true ,
35
+ } ,
36
+ ) ;
37
+
38
+ assert . ok (
39
+ ! ( "reason" in compilationJobsResult ) ,
40
+ "getCompilationJobs should not error" ,
41
+ ) ;
42
+
43
+ const compilationJobs = compilationJobsResult . compilationJobsPerFile ;
34
44
35
45
assert . ok ( compilationJobs instanceof Map , "compilationJobs should be a Map" ) ;
36
46
@@ -264,25 +274,6 @@ describe(
264
274
) ;
265
275
} ) ;
266
276
267
- it ( "should not recompile the project when given the same input as in the previous call" , async ( ) => {
268
- const rootFilePaths = await solidity . getRootFilePaths ( ) ;
269
- await solidity . build ( rootFilePaths , {
270
- force : true ,
271
- isolated : false ,
272
- quiet : true ,
273
- } ) ;
274
-
275
- const runCompilationJobSpy = mock . method ( solidity , "runCompilationJob" ) ;
276
-
277
- await solidity . build ( rootFilePaths , {
278
- force : false ,
279
- isolated : false ,
280
- quiet : true ,
281
- } ) ;
282
-
283
- assert . equal ( runCompilationJobSpy . mock . callCount ( ) , 0 ) ;
284
- } ) ;
285
-
286
277
it ( "should recompile the project when given the same input as in the previous call but the force flag is set" , async ( ) => {
287
278
const rootFilePaths = await solidity . getRootFilePaths ( ) ;
288
279
await solidity . build ( rootFilePaths , {
@@ -302,81 +293,6 @@ describe(
302
293
assert . equal ( runCompilationJobSpy . mock . callCount ( ) , 2 ) ;
303
294
} ) ;
304
295
305
- it ( "should not recompile the project when the input changed but the generated compilation jobs are the subset of the previous ones" , async ( ) => {
306
- const rootFilePaths = await solidity . getRootFilePaths ( ) ;
307
- await solidity . build ( rootFilePaths , {
308
- force : true ,
309
- isolated : false ,
310
- quiet : true ,
311
- } ) ;
312
-
313
- const runCompilationJobSpy = mock . method ( solidity , "runCompilationJob" ) ;
314
-
315
- await solidity . build (
316
- rootFilePaths . filter ( ( f ) => path . basename ( f ) !== "NoImports.sol" ) ,
317
- {
318
- force : false ,
319
- isolated : false ,
320
- quiet : true ,
321
- } ,
322
- ) ;
323
-
324
- assert . equal ( runCompilationJobSpy . mock . callCount ( ) , 0 ) ;
325
- } ) ;
326
-
327
- it ( "should recompile the project when the input changed and the generated compilation jobs changed" , async ( ) => {
328
- const rootFilePaths = await solidity . getRootFilePaths ( ) ;
329
- await solidity . build ( rootFilePaths , {
330
- force : true ,
331
- isolated : false ,
332
- quiet : true ,
333
- } ) ;
334
-
335
- const runCompilationJobSpy = mock . method ( solidity , "runCompilationJob" ) ;
336
-
337
- await solidity . build (
338
- rootFilePaths . filter ( ( f ) => path . basename ( f ) !== "A.sol" ) ,
339
- {
340
- force : false ,
341
- isolated : false ,
342
- quiet : true ,
343
- } ,
344
- ) ;
345
-
346
- assert . equal ( runCompilationJobSpy . mock . callCount ( ) , 1 ) ;
347
- } ) ;
348
-
349
- it ( "should not recompile the project when the input is the same as in one of the previous calls" , async ( ) => {
350
- const rootFilePaths = await solidity . getRootFilePaths ( ) ;
351
- await solidity . build ( rootFilePaths , {
352
- force : true ,
353
- isolated : false ,
354
- quiet : true ,
355
- } ) ;
356
-
357
- await solidity . build (
358
- rootFilePaths . filter ( ( f ) => path . basename ( f ) !== "A.sol" ) ,
359
- {
360
- force : false ,
361
- isolated : false ,
362
- quiet : true ,
363
- } ,
364
- ) ;
365
-
366
- const runCompilationJobSpy = mock . method ( solidity , "runCompilationJob" ) ;
367
-
368
- await solidity . build (
369
- rootFilePaths . filter ( ( f ) => path . basename ( f ) !== "A.sol" ) ,
370
- {
371
- force : false ,
372
- isolated : false ,
373
- quiet : true ,
374
- } ,
375
- ) ;
376
-
377
- assert . equal ( runCompilationJobSpy . mock . callCount ( ) , 0 ) ;
378
- } ) ;
379
-
380
296
it ( "should throw when given a build profile that is not defined" , async ( ) => {
381
297
const rootFilePaths = await solidity . getRootFilePaths ( ) ;
382
298
0 commit comments