@@ -6,7 +6,7 @@ import { HardhatError } from "@ignored/hardhat-vnext-errors";
6
6
import {
7
7
assertIsHardhatError ,
8
8
assertThrowsHardhatError ,
9
- assertThrowsHardhatErrorAsync ,
9
+ assertRejectsWithHardhatError ,
10
10
} from "../src/hardhat-error.js" ;
11
11
12
12
describe ( "HardhatError helpers" , ( ) => {
@@ -105,10 +105,10 @@ describe("HardhatError helpers", () => {
105
105
} ) ;
106
106
} ) ;
107
107
108
- describe ( "assertThrowsHardhatErrorAsync " , ( ) => {
108
+ describe ( "assertRejectsWithHardhatError " , ( ) => {
109
109
it ( "should throw if the function doesn't return a promise that rejects" , async ( ) => {
110
110
await assert . rejects ( async ( ) =>
111
- assertThrowsHardhatErrorAsync (
111
+ assertRejectsWithHardhatError (
112
112
async ( ) => { } ,
113
113
HardhatError . ERRORS . TASK_DEFINITIONS . INVALID_ACTION ,
114
114
{ action : "foo" , task : "bar" } ,
@@ -118,7 +118,7 @@ describe("HardhatError helpers", () => {
118
118
119
119
it ( "should throw the promise that rejects" , async ( ) => {
120
120
await assert . rejects ( async ( ) =>
121
- assertThrowsHardhatErrorAsync (
121
+ assertRejectsWithHardhatError (
122
122
Promise . resolve ( 1 ) ,
123
123
HardhatError . ERRORS . TASK_DEFINITIONS . INVALID_ACTION ,
124
124
{ action : "foo" , task : "bar" } ,
@@ -128,7 +128,7 @@ describe("HardhatError helpers", () => {
128
128
129
129
it ( "asserts the error of the rejection" , async ( ) => {
130
130
await assert . rejects ( ( ) =>
131
- assertThrowsHardhatErrorAsync (
131
+ assertRejectsWithHardhatError (
132
132
async ( ) => {
133
133
throw new HardhatError (
134
134
HardhatError . ERRORS . TASK_DEFINITIONS . UNRECOGNIZED_TASK_OPTION ,
@@ -141,7 +141,7 @@ describe("HardhatError helpers", () => {
141
141
) ;
142
142
143
143
await assert . rejects ( ( ) =>
144
- assertThrowsHardhatErrorAsync (
144
+ assertRejectsWithHardhatError (
145
145
Promise . reject (
146
146
new HardhatError (
147
147
HardhatError . ERRORS . TASK_DEFINITIONS . UNRECOGNIZED_TASK_OPTION ,
@@ -153,7 +153,7 @@ describe("HardhatError helpers", () => {
153
153
) ,
154
154
) ;
155
155
156
- await assertThrowsHardhatErrorAsync (
156
+ await assertRejectsWithHardhatError (
157
157
async ( ) => {
158
158
throw new HardhatError (
159
159
HardhatError . ERRORS . TASK_DEFINITIONS . UNRECOGNIZED_TASK_OPTION ,
0 commit comments