@@ -11,16 +11,16 @@ beforeEach(function () {
11
11
contracts_directory : "./test/sources" ,
12
12
contracts_build_directory : "./test/build" ,
13
13
logger : {
14
- log ( stringToLog ) {
14
+ log ( stringToLog : string ) {
15
15
this . loggedStuff = this . loggedStuff + stringToLog ;
16
16
} ,
17
17
loggedStuff : ""
18
18
}
19
19
} ) ;
20
20
} ) ;
21
21
22
- after ( ( ) => {
23
- removeSync ( join ( ` ${ process . cwd ( ) } / ${ config . contracts_build_directory } ` ) ) ;
22
+ afterEach ( function ( ) {
23
+ removeSync ( config . contracts_build_directory ) ;
24
24
} ) ;
25
25
26
26
describe ( "Contracts.compile" , ( ) => {
@@ -35,27 +35,21 @@ describe("Contracts.compile", () => {
35
35
}
36
36
} ) ;
37
37
38
- describe ( "when config.all is true" , ( ) => {
39
- it ( "recompiles all contracts in contracts_directory" , async function ( ) {
40
- this . timeout ( 4000 ) ;
41
- // initial compile
42
- const { contracts } = await Contracts . compileAndSave ( config ) ;
43
-
44
- let contractName = contracts [ 0 ] . contractName ;
45
- assert (
46
- existsSync ( `${ config . contracts_build_directory } /${ contractName } .json` )
47
- ) ;
48
-
49
- // compile again
50
- config . all = true ;
51
- const { compilations } = await Contracts . compileAndSave ( config ) ;
52
-
53
- assert (
54
- compilations [ 0 ] . sourceIndexes [ 0 ] ===
55
- join (
56
- `${ process . cwd ( ) } /${ config . contracts_directory } /${ contractName } .sol`
57
- )
58
- ) ;
59
- } ) ;
38
+ it ( "recompiles all contracts when config === true" , async function ( ) {
39
+ this . timeout ( 4000 ) ;
40
+ // initial compile
41
+ const { contracts } = await Contracts . compileAndSave ( config ) ;
42
+ let contractName = contracts [ 0 ] . contractName ;
43
+ assert (
44
+ existsSync ( `${ config . contracts_build_directory } /${ contractName } .json` )
45
+ ) ;
46
+
47
+ // compile again
48
+ config . all = true ;
49
+ const { compilations } = await Contracts . compileAndSave ( config ) ;
50
+ assert (
51
+ compilations [ 0 ] . sourceIndexes [ 0 ] ===
52
+ join ( config . contracts_directory , `${ contractName } .sol` )
53
+ ) ;
60
54
} ) ;
61
55
} ) ;
0 commit comments