Skip to content

Commit e95f5ec

Browse files
committed
Use the new name of the async error assertion
1 parent cf61006 commit e95f5ec

File tree

9 files changed

+64
-64
lines changed

9 files changed

+64
-64
lines changed

v-next/core/test/internal/configuration-variables/configuration-variables.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import assert from "node:assert/strict";
22
import { before, describe, it } from "node:test";
33

44
import { HardhatError } from "@ignored/hardhat-vnext-errors";
5-
import { assertThrowsHardhatErrorAsync } from "@nomicfoundation/hardhat-test-utils";
5+
import { assertRejectsWithHardhatError } from "@nomicfoundation/hardhat-test-utils";
66

77
import { ResolvedConfigurationVariableImplementation } from "../../../src/internal/configuration-variables.js";
88
import { HookManagerImplementation } from "../../../src/internal/hook-manager.js";
@@ -56,7 +56,7 @@ describe("ResolvedConfigurationVariable", () => {
5656
{ name: "foo", _type: "ConfigurationVariable" },
5757
);
5858

59-
await assertThrowsHardhatErrorAsync(
59+
await assertRejectsWithHardhatError(
6060
variable.get(),
6161
HardhatError.ERRORS.GENERAL.ENV_VAR_NOT_FOUND,
6262
{},
@@ -101,7 +101,7 @@ describe("ResolvedConfigurationVariable", () => {
101101

102102
process.env.foo = "not a url";
103103

104-
await assertThrowsHardhatErrorAsync(
104+
await assertRejectsWithHardhatError(
105105
variable.getUrl(),
106106
HardhatError.ERRORS.GENERAL.INVALID_URL,
107107
{
@@ -133,7 +133,7 @@ describe("ResolvedConfigurationVariable", () => {
133133

134134
process.env.foo = "not a bigint";
135135

136-
await assertThrowsHardhatErrorAsync(
136+
await assertRejectsWithHardhatError(
137137
variable.getBigInt(),
138138
HardhatError.ERRORS.GENERAL.INVALID_BIGINT,
139139
{

v-next/core/test/internal/hook-manager.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import { describe, it, beforeEach } from "node:test";
2323

2424
import { HardhatError } from "@ignored/hardhat-vnext-errors";
2525
import { ensureError } from "@ignored/hardhat-vnext-utils/error";
26-
import { assertThrowsHardhatErrorAsync } from "@nomicfoundation/hardhat-test-utils";
26+
import { assertRejectsWithHardhatError } from "@nomicfoundation/hardhat-test-utils";
2727

2828
import { HookManagerImplementation } from "../../src/internal/hook-manager.js";
2929
import { UserInterruptionManagerImplementation } from "../../src/internal/user-interruptions.js";
@@ -266,7 +266,7 @@ describe("HookManager", () => {
266266

267267
const manager = new HookManagerImplementation([examplePlugin]);
268268

269-
await assertThrowsHardhatErrorAsync(
269+
await assertRejectsWithHardhatError(
270270
async () =>
271271
manager.runHandlerChain(
272272
"config",

v-next/core/test/internal/plugins/detect-plugin-npm-dependency-problems.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import type { HardhatPlugin } from "../../../src/types/plugins.js";
33
import { describe, it } from "node:test";
44

55
import { HardhatError } from "@ignored/hardhat-vnext-errors";
6-
import { assertThrowsHardhatErrorAsync } from "@nomicfoundation/hardhat-test-utils";
6+
import { assertRejectsWithHardhatError } from "@nomicfoundation/hardhat-test-utils";
77

88
import { detectPluginNpmDependencyProblems } from "../../../src/internal/plugins/detect-plugin-npm-dependency-problems.js";
99

@@ -44,7 +44,7 @@ describe("Plugins - detect npm dependency problems", () => {
4444
"./fixture-projects/not-installed-package",
4545
);
4646

47-
await assertThrowsHardhatErrorAsync(
47+
await assertRejectsWithHardhatError(
4848
async () =>
4949
detectPluginNpmDependencyProblems(
5050
plugin,
@@ -76,7 +76,7 @@ describe("Plugins - detect npm dependency problems", () => {
7676
"./fixture-projects/not-installed-peer-dep",
7777
);
7878

79-
await assertThrowsHardhatErrorAsync(
79+
await assertRejectsWithHardhatError(
8080
detectPluginNpmDependencyProblems(plugin, notInstalledPeerDepFixture),
8181
HardhatError.ERRORS.PLUGINS.PLUGIN_MISSING_DEPENDENCY,
8282
{ pluginId: "example-plugin", peerDependencyName: "peer2" },
@@ -104,7 +104,7 @@ describe("Plugins - detect npm dependency problems", () => {
104104
"./fixture-projects/peer-dep-with-wrong-version",
105105
);
106106

107-
await assertThrowsHardhatErrorAsync(
107+
await assertRejectsWithHardhatError(
108108
async () =>
109109
detectPluginNpmDependencyProblems(
110110
plugin,

v-next/core/test/internal/plugins/resolve-plugin-list.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import assert from "node:assert/strict";
44
import { describe, it } from "node:test";
55

66
import { HardhatError } from "@ignored/hardhat-vnext-errors";
7-
import { assertThrowsHardhatErrorAsync } from "@nomicfoundation/hardhat-test-utils";
7+
import { assertRejectsWithHardhatError } from "@nomicfoundation/hardhat-test-utils";
88

99
import { resolvePluginList } from "../../../src/internal/plugins/resolve-plugin-list.js";
1010

@@ -150,7 +150,7 @@ describe("Plugins - resolve plugin list", () => {
150150
const a = { id: "dup" };
151151
const copy = { id: "dup" };
152152

153-
await assertThrowsHardhatErrorAsync(
153+
await assertRejectsWithHardhatError(
154154
async () => resolvePluginList([a, copy], installedPackageFixture),
155155
HardhatError.ERRORS.GENERAL.DUPLICATED_PLUGIN_ID,
156156
{
@@ -171,7 +171,7 @@ describe("Plugins - resolve plugin list", () => {
171171
],
172172
};
173173

174-
await assertThrowsHardhatErrorAsync(
174+
await assertRejectsWithHardhatError(
175175
async () => resolvePluginList([plugin], installedPackageFixture),
176176
HardhatError.ERRORS.PLUGINS.PLUGIN_DEPENDENCY_FAILED_LOAD,
177177
{ pluginId: plugin.id },
@@ -193,7 +193,7 @@ describe("Plugins - resolve plugin list", () => {
193193
],
194194
};
195195

196-
await assertThrowsHardhatErrorAsync(
196+
await assertRejectsWithHardhatError(
197197
async () => resolvePluginList([plugin], notInstalledPackageFixture),
198198
HardhatError.ERRORS.PLUGINS.PLUGIN_NOT_INSTALLED,
199199
{

0 commit comments

Comments
 (0)