Skip to content
This repository was archived by the owner on Feb 26, 2024. It is now read-only.

Commit 919d0de

Browse files
committed
update a test
1 parent 9f7c8da commit 919d0de

File tree

1 file changed

+19
-25
lines changed

1 file changed

+19
-25
lines changed

packages/workflow-compile/test/index.ts

Lines changed: 19 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,16 @@ beforeEach(function () {
1111
contracts_directory: "./test/sources",
1212
contracts_build_directory: "./test/build",
1313
logger: {
14-
log(stringToLog) {
14+
log(stringToLog: string) {
1515
this.loggedStuff = this.loggedStuff + stringToLog;
1616
},
1717
loggedStuff: ""
1818
}
1919
});
2020
});
2121

22-
after(() => {
23-
removeSync(join(`${process.cwd()}/${config.contracts_build_directory}`));
22+
afterEach(function () {
23+
removeSync(config.contracts_build_directory);
2424
});
2525

2626
describe("Contracts.compile", () => {
@@ -35,27 +35,21 @@ describe("Contracts.compile", () => {
3535
}
3636
});
3737

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+
);
6054
});
6155
});

0 commit comments

Comments
 (0)