Skip to content

Commit

Permalink
Use the new name of the async error assertion
Browse files Browse the repository at this point in the history
  • Loading branch information
alcuadrado committed Jul 9, 2024
1 parent cf61006 commit e95f5ec
Show file tree
Hide file tree
Showing 9 changed files with 64 additions and 64 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -56,7 +56,7 @@ describe("ResolvedConfigurationVariable", () => {
{ name: "foo", _type: "ConfigurationVariable" },
);

await assertThrowsHardhatErrorAsync(
await assertRejectsWithHardhatError(
variable.get(),
HardhatError.ERRORS.GENERAL.ENV_VAR_NOT_FOUND,
{},
Expand Down Expand Up @@ -101,7 +101,7 @@ describe("ResolvedConfigurationVariable", () => {

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

await assertThrowsHardhatErrorAsync(
await assertRejectsWithHardhatError(
variable.getUrl(),
HardhatError.ERRORS.GENERAL.INVALID_URL,
{
Expand Down Expand Up @@ -133,7 +133,7 @@ describe("ResolvedConfigurationVariable", () => {

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

await assertThrowsHardhatErrorAsync(
await assertRejectsWithHardhatError(
variable.getBigInt(),
HardhatError.ERRORS.GENERAL.INVALID_BIGINT,
{
Expand Down
4 changes: 2 additions & 2 deletions v-next/core/test/internal/hook-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -266,7 +266,7 @@ describe("HookManager", () => {

const manager = new HookManagerImplementation([examplePlugin]);

await assertThrowsHardhatErrorAsync(
await assertRejectsWithHardhatError(
async () =>
manager.runHandlerChain(
"config",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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";

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

await assertThrowsHardhatErrorAsync(
await assertRejectsWithHardhatError(
async () =>
detectPluginNpmDependencyProblems(
plugin,
Expand Down Expand Up @@ -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" },
Expand Down Expand Up @@ -104,7 +104,7 @@ describe("Plugins - detect npm dependency problems", () => {
"./fixture-projects/peer-dep-with-wrong-version",
);

await assertThrowsHardhatErrorAsync(
await assertRejectsWithHardhatError(
async () =>
detectPluginNpmDependencyProblems(
plugin,
Expand Down
8 changes: 4 additions & 4 deletions v-next/core/test/internal/plugins/resolve-plugin-list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand Down Expand Up @@ -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,
{
Expand All @@ -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 },
Expand All @@ -193,7 +193,7 @@ describe("Plugins - resolve plugin list", () => {
],
};

await assertThrowsHardhatErrorAsync(
await assertRejectsWithHardhatError(
async () => resolvePluginList([plugin], notInstalledPackageFixture),
HardhatError.ERRORS.PLUGINS.PLUGIN_NOT_INSTALLED,
{
Expand Down
Loading

0 comments on commit e95f5ec

Please sign in to comment.