diff --git a/v-next/core/test/internal/configuration-variables/configuration-variables.ts b/v-next/core/test/internal/configuration-variables/configuration-variables.ts index 70e069363a..509b47eac0 100644 --- a/v-next/core/test/internal/configuration-variables/configuration-variables.ts +++ b/v-next/core/test/internal/configuration-variables/configuration-variables.ts @@ -2,7 +2,7 @@ import assert from "node:assert/strict"; import { before, describe, it } from "node:test"; import { HardhatError } from "@ignored/hardhat-vnext-errors"; -import { assertThrowsHardhatErrorAsync } from "@nomicfoundation/hardhat-test-utils"; +import { assertRejectsWithHardhatError } from "@nomicfoundation/hardhat-test-utils"; import { ResolvedConfigurationVariableImplementation } from "../../../src/internal/configuration-variables.js"; import { HookManagerImplementation } from "../../../src/internal/hook-manager.js"; @@ -56,7 +56,7 @@ describe("ResolvedConfigurationVariable", () => { { name: "foo", _type: "ConfigurationVariable" }, ); - await assertThrowsHardhatErrorAsync( + await assertRejectsWithHardhatError( variable.get(), HardhatError.ERRORS.GENERAL.ENV_VAR_NOT_FOUND, {}, @@ -101,7 +101,7 @@ describe("ResolvedConfigurationVariable", () => { process.env.foo = "not a url"; - await assertThrowsHardhatErrorAsync( + await assertRejectsWithHardhatError( variable.getUrl(), HardhatError.ERRORS.GENERAL.INVALID_URL, { @@ -133,7 +133,7 @@ describe("ResolvedConfigurationVariable", () => { process.env.foo = "not a bigint"; - await assertThrowsHardhatErrorAsync( + await assertRejectsWithHardhatError( variable.getBigInt(), HardhatError.ERRORS.GENERAL.INVALID_BIGINT, { diff --git a/v-next/core/test/internal/hook-manager.ts b/v-next/core/test/internal/hook-manager.ts index 5080d80eb2..67753c77c6 100644 --- a/v-next/core/test/internal/hook-manager.ts +++ b/v-next/core/test/internal/hook-manager.ts @@ -23,7 +23,7 @@ import { describe, it, beforeEach } from "node:test"; import { HardhatError } from "@ignored/hardhat-vnext-errors"; import { ensureError } from "@ignored/hardhat-vnext-utils/error"; -import { assertThrowsHardhatErrorAsync } from "@nomicfoundation/hardhat-test-utils"; +import { assertRejectsWithHardhatError } from "@nomicfoundation/hardhat-test-utils"; import { HookManagerImplementation } from "../../src/internal/hook-manager.js"; import { UserInterruptionManagerImplementation } from "../../src/internal/user-interruptions.js"; @@ -266,7 +266,7 @@ describe("HookManager", () => { const manager = new HookManagerImplementation([examplePlugin]); - await assertThrowsHardhatErrorAsync( + await assertRejectsWithHardhatError( async () => manager.runHandlerChain( "config", diff --git a/v-next/core/test/internal/plugins/detect-plugin-npm-dependency-problems.ts b/v-next/core/test/internal/plugins/detect-plugin-npm-dependency-problems.ts index 6e80d0d022..be29066be5 100644 --- a/v-next/core/test/internal/plugins/detect-plugin-npm-dependency-problems.ts +++ b/v-next/core/test/internal/plugins/detect-plugin-npm-dependency-problems.ts @@ -3,7 +3,7 @@ import type { HardhatPlugin } from "../../../src/types/plugins.js"; import { describe, it } from "node:test"; import { HardhatError } from "@ignored/hardhat-vnext-errors"; -import { assertThrowsHardhatErrorAsync } from "@nomicfoundation/hardhat-test-utils"; +import { assertRejectsWithHardhatError } from "@nomicfoundation/hardhat-test-utils"; import { detectPluginNpmDependencyProblems } from "../../../src/internal/plugins/detect-plugin-npm-dependency-problems.js"; @@ -44,7 +44,7 @@ describe("Plugins - detect npm dependency problems", () => { "./fixture-projects/not-installed-package", ); - await assertThrowsHardhatErrorAsync( + await assertRejectsWithHardhatError( async () => detectPluginNpmDependencyProblems( plugin, @@ -76,7 +76,7 @@ describe("Plugins - detect npm dependency problems", () => { "./fixture-projects/not-installed-peer-dep", ); - await assertThrowsHardhatErrorAsync( + await assertRejectsWithHardhatError( detectPluginNpmDependencyProblems(plugin, notInstalledPeerDepFixture), HardhatError.ERRORS.PLUGINS.PLUGIN_MISSING_DEPENDENCY, { pluginId: "example-plugin", peerDependencyName: "peer2" }, @@ -104,7 +104,7 @@ describe("Plugins - detect npm dependency problems", () => { "./fixture-projects/peer-dep-with-wrong-version", ); - await assertThrowsHardhatErrorAsync( + await assertRejectsWithHardhatError( async () => detectPluginNpmDependencyProblems( plugin, diff --git a/v-next/core/test/internal/plugins/resolve-plugin-list.ts b/v-next/core/test/internal/plugins/resolve-plugin-list.ts index dc57dd9f18..25ca50089a 100644 --- a/v-next/core/test/internal/plugins/resolve-plugin-list.ts +++ b/v-next/core/test/internal/plugins/resolve-plugin-list.ts @@ -4,7 +4,7 @@ import assert from "node:assert/strict"; import { describe, it } from "node:test"; import { HardhatError } from "@ignored/hardhat-vnext-errors"; -import { assertThrowsHardhatErrorAsync } from "@nomicfoundation/hardhat-test-utils"; +import { assertRejectsWithHardhatError } from "@nomicfoundation/hardhat-test-utils"; import { resolvePluginList } from "../../../src/internal/plugins/resolve-plugin-list.js"; @@ -150,7 +150,7 @@ describe("Plugins - resolve plugin list", () => { const a = { id: "dup" }; const copy = { id: "dup" }; - await assertThrowsHardhatErrorAsync( + await assertRejectsWithHardhatError( async () => resolvePluginList([a, copy], installedPackageFixture), HardhatError.ERRORS.GENERAL.DUPLICATED_PLUGIN_ID, { @@ -171,7 +171,7 @@ describe("Plugins - resolve plugin list", () => { ], }; - await assertThrowsHardhatErrorAsync( + await assertRejectsWithHardhatError( async () => resolvePluginList([plugin], installedPackageFixture), HardhatError.ERRORS.PLUGINS.PLUGIN_DEPENDENCY_FAILED_LOAD, { pluginId: plugin.id }, @@ -193,7 +193,7 @@ describe("Plugins - resolve plugin list", () => { ], }; - await assertThrowsHardhatErrorAsync( + await assertRejectsWithHardhatError( async () => resolvePluginList([plugin], notInstalledPackageFixture), HardhatError.ERRORS.PLUGINS.PLUGIN_NOT_INSTALLED, { diff --git a/v-next/core/test/internal/tasks/task-manager.ts b/v-next/core/test/internal/tasks/task-manager.ts index 0b301e607f..16b7214838 100644 --- a/v-next/core/test/internal/tasks/task-manager.ts +++ b/v-next/core/test/internal/tasks/task-manager.ts @@ -4,7 +4,7 @@ import { describe, it } from "node:test"; import { HardhatError } from "@ignored/hardhat-vnext-errors"; import { assertThrowsHardhatError, - assertThrowsHardhatErrorAsync, + assertRejectsWithHardhatError, } from "@nomicfoundation/hardhat-test-utils"; import { ArgumentType, globalOption } from "../../../src/config.js"; @@ -380,7 +380,7 @@ describe("TaskManagerImplementation", () => { */ describe("errors", () => { it("should throw if there's a global option with the same name as a task option", async () => { - await assertThrowsHardhatErrorAsync( + await assertRejectsWithHardhatError( createBaseHardhatRuntimeEnvironment({ plugins: [ { @@ -417,7 +417,7 @@ describe("TaskManagerImplementation", () => { }); it("should throw if there's a global option with the same name as a task positional argument", async () => { - await assertThrowsHardhatErrorAsync( + await assertRejectsWithHardhatError( createBaseHardhatRuntimeEnvironment({ plugins: [ { @@ -454,7 +454,7 @@ describe("TaskManagerImplementation", () => { }); it("should throw if trying to add a task with an empty id", async () => { - await assertThrowsHardhatErrorAsync( + await assertRejectsWithHardhatError( createBaseHardhatRuntimeEnvironment({ plugins: [ { @@ -479,7 +479,7 @@ describe("TaskManagerImplementation", () => { }); it("should throw if trying to add a subtask for a task that doesn't exist", async () => { - await assertThrowsHardhatErrorAsync( + await assertRejectsWithHardhatError( createBaseHardhatRuntimeEnvironment({ plugins: [ { @@ -505,7 +505,7 @@ describe("TaskManagerImplementation", () => { }); it("should throw if trying to add a task that already exists", async () => { - await assertThrowsHardhatErrorAsync( + await assertRejectsWithHardhatError( createBaseHardhatRuntimeEnvironment({ plugins: [ { @@ -539,7 +539,7 @@ describe("TaskManagerImplementation", () => { it("should throw if trying to override a task that doesn't exist", async () => { // Empty id task will not be found as empty ids are not allowed - await assertThrowsHardhatErrorAsync( + await assertRejectsWithHardhatError( createBaseHardhatRuntimeEnvironment({ plugins: [ { @@ -564,7 +564,7 @@ describe("TaskManagerImplementation", () => { ); // task1 will not be found as it's not defined - await assertThrowsHardhatErrorAsync( + await assertRejectsWithHardhatError( createBaseHardhatRuntimeEnvironment({ plugins: [ { @@ -586,7 +586,7 @@ describe("TaskManagerImplementation", () => { it("should throw if trying to override a task and there is a name clash with an existing option", async () => { // added argument clash with an existing option - await assertThrowsHardhatErrorAsync( + await assertRejectsWithHardhatError( createBaseHardhatRuntimeEnvironment({ plugins: [ { @@ -619,7 +619,7 @@ describe("TaskManagerImplementation", () => { ); // added flag clash with an existing option - await assertThrowsHardhatErrorAsync( + await assertRejectsWithHardhatError( createBaseHardhatRuntimeEnvironment({ plugins: [ { @@ -654,7 +654,7 @@ describe("TaskManagerImplementation", () => { it("should throw if trying to override a task and there is a name clash with an exising flag argument", async () => { // added argument clash with an existing flag - await assertThrowsHardhatErrorAsync( + await assertRejectsWithHardhatError( createBaseHardhatRuntimeEnvironment({ plugins: [ { @@ -687,7 +687,7 @@ describe("TaskManagerImplementation", () => { ); // added flag clash with an existing flag - await assertThrowsHardhatErrorAsync( + await assertRejectsWithHardhatError( createBaseHardhatRuntimeEnvironment({ plugins: [ { @@ -722,7 +722,7 @@ describe("TaskManagerImplementation", () => { it("should throw if trying to override a task and there is a name clash with an exising positional argument", async () => { // added argument clash with an existing positional argument - await assertThrowsHardhatErrorAsync( + await assertRejectsWithHardhatError( createBaseHardhatRuntimeEnvironment({ plugins: [ { @@ -755,7 +755,7 @@ describe("TaskManagerImplementation", () => { ); // added flag clash with an existing positional argument - await assertThrowsHardhatErrorAsync( + await assertRejectsWithHardhatError( createBaseHardhatRuntimeEnvironment({ plugins: [ { @@ -790,7 +790,7 @@ describe("TaskManagerImplementation", () => { it("should throw if trying to override a task and there is a name clash with an exising variadic argument", async () => { // added argument clash with an existing variadic argument - await assertThrowsHardhatErrorAsync( + await assertRejectsWithHardhatError( createBaseHardhatRuntimeEnvironment({ plugins: [ { @@ -823,7 +823,7 @@ describe("TaskManagerImplementation", () => { ); // added flag clash with an existing variadic argument - await assertThrowsHardhatErrorAsync( + await assertRejectsWithHardhatError( createBaseHardhatRuntimeEnvironment({ plugins: [ { @@ -859,7 +859,7 @@ describe("TaskManagerImplementation", () => { it("should throw if a plugins tries to override a task defined in the config", async () => { // this will fail as the config tasks are processed after // the plugin tasks so the override logic will not find task1 - await assertThrowsHardhatErrorAsync( + await assertRejectsWithHardhatError( createBaseHardhatRuntimeEnvironment({ tasks: [ new NewTaskDefinitionBuilderImplementation("task1") @@ -1284,7 +1284,7 @@ describe("TaskManagerImplementation", () => { }); const task1 = hre.tasks.getTask("task1"); - await assertThrowsHardhatErrorAsync( + await assertRejectsWithHardhatError( task1.run({}), HardhatError.ERRORS.TASK_DEFINITIONS.EMPTY_TASK, { @@ -1308,7 +1308,7 @@ describe("TaskManagerImplementation", () => { }); const task1 = hre.tasks.getTask("task1"); - await assertThrowsHardhatErrorAsync( + await assertRejectsWithHardhatError( task1.run({ otherArg: "otherArgValue" }), HardhatError.ERRORS.TASK_DEFINITIONS.UNRECOGNIZED_TASK_OPTION, { @@ -1338,7 +1338,7 @@ describe("TaskManagerImplementation", () => { const task1 = hre.tasks.getTask("task1"); // option is missing - await assertThrowsHardhatErrorAsync( + await assertRejectsWithHardhatError( task1.run({ posArg: "posValue", varArg: ["varValue1", "varValue2"], @@ -1351,7 +1351,7 @@ describe("TaskManagerImplementation", () => { ); // posArg is missing - await assertThrowsHardhatErrorAsync( + await assertRejectsWithHardhatError( task1.run({ option: "arg1Value", varArg: ["varValue1", "varValue2"], @@ -1364,7 +1364,7 @@ describe("TaskManagerImplementation", () => { ); // varArg is missing - await assertThrowsHardhatErrorAsync( + await assertRejectsWithHardhatError( task1.run({ option: "arg1Value", posArg: "posValue", @@ -1406,7 +1406,7 @@ describe("TaskManagerImplementation", () => { const task1 = hre.tasks.getTask("task1"); // option has the wrong type - await assertThrowsHardhatErrorAsync( + await assertRejectsWithHardhatError( task1.run({ option: "not a bigint", posArg: 10, @@ -1422,7 +1422,7 @@ describe("TaskManagerImplementation", () => { ); // posArg has the wrong type - await assertThrowsHardhatErrorAsync( + await assertRejectsWithHardhatError( task1.run({ option: 5n, posArg: true, @@ -1438,7 +1438,7 @@ describe("TaskManagerImplementation", () => { ); // varArg has the wrong type (not an array) - await assertThrowsHardhatErrorAsync( + await assertRejectsWithHardhatError( task1.run({ option: 5n, posArg: 10, @@ -1454,7 +1454,7 @@ describe("TaskManagerImplementation", () => { ); // varArg has the wrong type (array element has the wrong type) - await assertThrowsHardhatErrorAsync( + await assertRejectsWithHardhatError( task1.run({ option: 5n, posArg: 10, @@ -1485,7 +1485,7 @@ describe("TaskManagerImplementation", () => { }); const task1 = hre.tasks.getTask("task1"); - await assertThrowsHardhatErrorAsync( + await assertRejectsWithHardhatError( task1.run({}), HardhatError.ERRORS.TASK_DEFINITIONS.INVALID_ACTION_URL, { @@ -1520,7 +1520,7 @@ describe("TaskManagerImplementation", () => { ], }); - await assertThrowsHardhatErrorAsync( + await assertRejectsWithHardhatError( hre.tasks.getTask("task1").run({}), HardhatError.ERRORS.PLUGINS.PLUGIN_NOT_INSTALLED, { @@ -1551,7 +1551,7 @@ describe("TaskManagerImplementation", () => { ], }); - await assertThrowsHardhatErrorAsync( + await assertRejectsWithHardhatError( hre.tasks.getTask("task1").run({}), HardhatError.ERRORS.PLUGINS.PLUGIN_NOT_INSTALLED, { @@ -1579,7 +1579,7 @@ describe("TaskManagerImplementation", () => { }); const task1 = hre.tasks.getTask("task1"); - await assertThrowsHardhatErrorAsync( + await assertRejectsWithHardhatError( task1.run({}), HardhatError.ERRORS.TASK_DEFINITIONS.INVALID_ACTION, { @@ -1608,7 +1608,7 @@ describe("TaskManagerImplementation", () => { }); const task1 = hre.tasks.getTask("task1"); - await assertThrowsHardhatErrorAsync( + await assertRejectsWithHardhatError( task1.run({}), HardhatError.ERRORS.TASK_DEFINITIONS.INVALID_ACTION, { diff --git a/v-next/hardhat/test/hre/index.ts b/v-next/hardhat/test/hre/index.ts index 8851664f02..06b4b7664d 100644 --- a/v-next/hardhat/test/hre/index.ts +++ b/v-next/hardhat/test/hre/index.ts @@ -2,7 +2,7 @@ import assert from "node:assert/strict"; import { afterEach, describe, it } from "node:test"; import { HardhatError } from "@ignored/hardhat-vnext-errors"; -import { assertThrowsHardhatErrorAsync } from "@nomicfoundation/hardhat-test-utils"; +import { assertRejectsWithHardhatError } from "@nomicfoundation/hardhat-test-utils"; import { resolveHardhatConfigPath } from "../../src/config.js"; import { createHardhatRuntimeEnvironment } from "../../src/hre.js"; @@ -65,7 +65,7 @@ describe("HRE", () => { }); it("should throw if the config file is not found", async () => { - await assertThrowsHardhatErrorAsync( + await assertRejectsWithHardhatError( resolveHardhatConfigPath(), HardhatError.ERRORS.GENERAL.NO_CONFIG_FILE_FOUND, {}, diff --git a/v-next/hardhat/test/internal/builtin-plugins/run/runScriptWIthHardhat.ts b/v-next/hardhat/test/internal/builtin-plugins/run/runScriptWIthHardhat.ts index 2aee7ac12a..c5be1c1860 100644 --- a/v-next/hardhat/test/internal/builtin-plugins/run/runScriptWIthHardhat.ts +++ b/v-next/hardhat/test/internal/builtin-plugins/run/runScriptWIthHardhat.ts @@ -3,7 +3,7 @@ import type { HardhatRuntimeEnvironment } from "@ignored/hardhat-vnext-core/type import { before, describe, it } from "node:test"; import { HardhatError } from "@ignored/hardhat-vnext-errors"; -import { assertThrowsHardhatErrorAsync } from "@nomicfoundation/hardhat-test-utils"; +import { assertRejectsWithHardhatError } from "@nomicfoundation/hardhat-test-utils"; import { createHardhatRuntimeEnvironment } from "../../../../src/hre.js"; import runScriptWithHardhat from "../../../../src/internal/builtin-plugins/run/runScriptWithHardhat.js"; @@ -17,7 +17,7 @@ describe("runScriptWithHardhat", function () { }); it("should throw if script is not a string", async function () { - await assertThrowsHardhatErrorAsync( + await assertRejectsWithHardhatError( runScriptWithHardhat({ script: 123, noCompile: false }, hre), HardhatError.ERRORS.INTERNAL.ASSERTION_ERROR, { @@ -27,7 +27,7 @@ describe("runScriptWithHardhat", function () { }); it("should throw if noCompile is not a boolean", async function () { - await assertThrowsHardhatErrorAsync( + await assertRejectsWithHardhatError( runScriptWithHardhat({ script: "script.js", noCompile: 123 }, hre), HardhatError.ERRORS.INTERNAL.ASSERTION_ERROR, { @@ -40,7 +40,7 @@ describe("runScriptWithHardhat", function () { useFixtureProject("run-js-script"); it("should throw if script does not exist", async function () { - await assertThrowsHardhatErrorAsync( + await assertRejectsWithHardhatError( runScriptWithHardhat( { script: "./scripts/non-existent.js", noCompile: false }, hre, @@ -60,7 +60,7 @@ describe("runScriptWithHardhat", function () { }); it("should throw if the script throws", async function () { - await assertThrowsHardhatErrorAsync( + await assertRejectsWithHardhatError( runScriptWithHardhat( { script: "./scripts/throws.js", noCompile: false }, hre, @@ -78,7 +78,7 @@ describe("runScriptWithHardhat", function () { useFixtureProject("run-ts-script"); it("should throw if script does not exist", async function () { - await assertThrowsHardhatErrorAsync( + await assertRejectsWithHardhatError( runScriptWithHardhat( { script: "./scripts/non-existent.ts", noCompile: false }, hre, @@ -98,7 +98,7 @@ describe("runScriptWithHardhat", function () { }); it("should throw if the script throws", async function () { - await assertThrowsHardhatErrorAsync( + await assertRejectsWithHardhatError( runScriptWithHardhat( { script: "./scripts/throws.ts", noCompile: false }, hre, diff --git a/v-next/hardhat/test/internal/cli/init/init.ts b/v-next/hardhat/test/internal/cli/init/init.ts index cc7bf6db84..a578d4edbb 100644 --- a/v-next/hardhat/test/internal/cli/init/init.ts +++ b/v-next/hardhat/test/internal/cli/init/init.ts @@ -8,7 +8,7 @@ import { readUtf8File, remove, } from "@ignored/hardhat-vnext-utils/fs"; -import { assertThrowsHardhatErrorAsync } from "@nomicfoundation/hardhat-test-utils"; +import { assertRejectsWithHardhatError } from "@nomicfoundation/hardhat-test-utils"; import { initHardhat } from "../../../../src/internal/cli/init/init.js"; import { EMPTY_HARDHAT_CONFIG } from "../../../../src/internal/cli/init/sample-config-file.js"; @@ -89,7 +89,7 @@ describe("init", function () { it("should throw an error because the project is not of type esm", async function () { process.env.HARDHAT_CREATE_EMPTY_TYPESCRIPT_HARDHAT_CONFIG = "true"; - await assertThrowsHardhatErrorAsync( + await assertRejectsWithHardhatError( async () => initHardhat(), HardhatError.ERRORS.GENERAL.ONLY_ESM_SUPPORTED, {}, @@ -103,7 +103,7 @@ describe("init", function () { it("should throw an error because the project is not of type esm", async function () { process.env.HARDHAT_CREATE_EMPTY_TYPESCRIPT_HARDHAT_CONFIG = "true"; - await assertThrowsHardhatErrorAsync( + await assertRejectsWithHardhatError( async () => initHardhat(), HardhatError.ERRORS.GENERAL.ONLY_ESM_SUPPORTED, {}, @@ -116,7 +116,7 @@ describe("init", function () { useFixtureProject("cli/init/already-in-hh-project"); it("should fail because there is already a hardhat.config.ts file", async function () { - await assertThrowsHardhatErrorAsync( + await assertRejectsWithHardhatError( async () => initHardhat(), HardhatError.ERRORS.GENERAL.HARDHAT_PROJECT_ALREADY_CREATED, { @@ -130,14 +130,14 @@ describe("init", function () { it("should fail because the command is not executed inside an interactive shell", async function () { if (process.platform === "win32") { // Test for windows CI - await assertThrowsHardhatErrorAsync( + await assertRejectsWithHardhatError( async () => initHardhat(), HardhatError.ERRORS.GENERAL.NOT_INSIDE_PROJECT_ON_WINDOWS, {}, ); } else { // Test for all others CI - await assertThrowsHardhatErrorAsync( + await assertRejectsWithHardhatError( async () => initHardhat(), HardhatError.ERRORS.GENERAL.NOT_IN_INTERACTIVE_SHELL, {}, diff --git a/v-next/hardhat/test/internal/cli/main.ts b/v-next/hardhat/test/internal/cli/main.ts index a16d49e3df..033530d841 100644 --- a/v-next/hardhat/test/internal/cli/main.ts +++ b/v-next/hardhat/test/internal/cli/main.ts @@ -24,7 +24,7 @@ import { HardhatError } from "@ignored/hardhat-vnext-errors"; import { isCi } from "@ignored/hardhat-vnext-utils/ci"; import { assertThrowsHardhatError, - assertThrowsHardhatErrorAsync, + assertRejectsWithHardhatError, } from "@nomicfoundation/hardhat-test-utils"; import chalk from "chalk"; @@ -373,7 +373,7 @@ For global options help run: hardhat --help`; const cliArguments = command.split(" ").slice(2); const usedCliArguments = new Array(cliArguments.length).fill(false); - await assertThrowsHardhatErrorAsync( + await assertRejectsWithHardhatError( async () => parseBuiltinGlobalOptions(cliArguments, usedCliArguments), HardhatError.ERRORS.ARGUMENTS.CANNOT_COMBINE_INIT_AND_CONFIG_PATH, {}, @@ -386,7 +386,7 @@ For global options help run: hardhat --help`; const cliArguments = command.split(" ").slice(2); const usedCliArguments = new Array(cliArguments.length).fill(false); - await assertThrowsHardhatErrorAsync( + await assertRejectsWithHardhatError( async () => parseBuiltinGlobalOptions(cliArguments, usedCliArguments), HardhatError.ERRORS.ARGUMENTS.DUPLICATED_NAME, { @@ -401,7 +401,7 @@ For global options help run: hardhat --help`; const cliArguments = command.split(" ").slice(2); const usedCliArguments = new Array(cliArguments.length).fill(false); - await assertThrowsHardhatErrorAsync( + await assertRejectsWithHardhatError( async () => parseBuiltinGlobalOptions(cliArguments, usedCliArguments), HardhatError.ERRORS.ARGUMENTS.MISSING_CONFIG_FILE, {},