Skip to content

Commit

Permalink
chore: clean up after failed flatten test run
Browse files Browse the repository at this point in the history
  • Loading branch information
galargh committed Nov 28, 2024
1 parent e2ab08e commit f7c461a
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions packages/hardhat-core/test/builtin-tasks/flatten.ts
Original file line number Diff line number Diff line change
Expand Up @@ -416,14 +416,17 @@ describe("Flatten task", () => {

it("should write to an output file when the parameter output is specified", async function () {
const outputFile = `${tmpdir()}/flatten.sol`;
await this.env.run(TASK_FLATTEN, {
files: ["contracts/A.sol", "contracts/D.sol"],
output: outputFile,
});
const expected = await getExpectedSol();
const actual = readFileSync(outputFile, "utf8");
assert.equal(actual, expected);
removeSync(outputFile);
try {
await this.env.run(TASK_FLATTEN, {
files: ["contracts/A.sol", "contracts/D.sol"],
output: outputFile,
});
const expected = await getExpectedSol();
const actual = readFileSync(outputFile, "utf8");
assert.equal(actual, expected);
} finally {
removeSync(outputFile);
}
});

describe("No contracts to flatten", () => {
Expand Down

0 comments on commit f7c461a

Please sign in to comment.