Skip to content

Commit 24ef213

Browse files
committed
Improve tests
1 parent 9641ac4 commit 24ef213

File tree

1 file changed

+8
-24
lines changed

1 file changed

+8
-24
lines changed

packages/hardhat-ignition/test/deploy/build-invocation.ts

Lines changed: 8 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ describe("deploy - build invocation", function () {
1212
const buildArgs: any[] = [];
1313
const buildOverride = overrideTask("build")
1414
.setAction(async () => ({
15-
default: async (args: any) => {
15+
default: async (args: any, _hre, runSuper) => {
1616
buildArgs.push(args);
17-
return { contractRootPaths: [], testRootPaths: [] };
17+
return runSuper(args);
1818
},
1919
}))
2020
.build();
@@ -51,18 +51,9 @@ describe("deploy - build invocation", function () {
5151
projectPath,
5252
);
5353

54-
// The deploy task continues after build and may fail looking for artifacts;
55-
// we only care about the build invocation args captured before that point.
56-
try {
57-
await hre.tasks.getTask(["ignition", "deploy"]).run({
58-
modulePath: path.join(
59-
projectPath,
60-
"ignition",
61-
"modules",
62-
"MyModule.js",
63-
),
64-
});
65-
} catch {}
54+
await hre.tasks.getTask(["ignition", "deploy"]).run({
55+
modulePath: path.join(projectPath, "ignition", "modules", "MyModule.js"),
56+
});
6657

6758
assert.equal(buildArgs.length, 1);
6859
assert.equal(buildArgs[0].noTests, false);
@@ -92,16 +83,9 @@ describe("deploy - build invocation", function () {
9283
projectPath,
9384
);
9485

95-
try {
96-
await hre.tasks.getTask(["ignition", "deploy"]).run({
97-
modulePath: path.join(
98-
projectPath,
99-
"ignition",
100-
"modules",
101-
"MyModule.js",
102-
),
103-
});
104-
} catch {}
86+
await hre.tasks.getTask(["ignition", "deploy"]).run({
87+
modulePath: path.join(projectPath, "ignition", "modules", "MyModule.js"),
88+
});
10589

10690
assert.equal(buildArgs.length, 1);
10791
assert.equal(buildArgs[0].noTests, true);

0 commit comments

Comments
 (0)