@@ -10,12 +10,12 @@ import { ensureError } from "@ignored/hardhat-vnext-utils/error";
10
10
* arguments.
11
11
*
12
12
* @param error The error.
13
- * @param descritor The error descriptor.
13
+ * @param descriptor The error descriptor.
14
14
* @param messageArguments The message arguments.
15
15
*/
16
16
export function assertIsHardhatError < ErrorDescriptorT extends ErrorDescriptor > (
17
17
error : unknown ,
18
- descritor : ErrorDescriptorT ,
18
+ descriptor : ErrorDescriptorT ,
19
19
messageArguments : HardhatError < ErrorDescriptorT > [ "messageArguments" ] ,
20
20
) : asserts error is HardhatError < ErrorDescriptorT > {
21
21
assert . ok ( HardhatError . isHardhatError ( error ) , "Error is not a HardhatError" ) ;
@@ -24,11 +24,11 @@ export function assertIsHardhatError<ErrorDescriptorT extends ErrorDescriptor>(
24
24
// in case the descriptors are different.
25
25
assert . equal (
26
26
error . descriptor . number ,
27
- descritor . number ,
28
- `Expected error number ${ descritor . number } , but got ${ error . descriptor . number } ` ,
27
+ descriptor . number ,
28
+ `Expected error number ${ descriptor . number } , but got ${ error . descriptor . number } ` ,
29
29
) ;
30
30
31
- assert . deepEqual ( error . descriptor , descritor ) ;
31
+ assert . deepEqual ( error . descriptor , descriptor ) ;
32
32
33
33
assert . deepEqual ( error . messageArguments , messageArguments ) ;
34
34
}
@@ -38,21 +38,21 @@ export function assertIsHardhatError<ErrorDescriptorT extends ErrorDescriptor>(
38
38
* descriptor and message arguments.
39
39
*
40
40
* @param f The function that should throw.
41
- * @param descritor The error descriptor.
41
+ * @param descriptor The error descriptor.
42
42
* @param messageArguments The message arguments.
43
43
*/
44
44
export function assertThrowsHardhatError <
45
45
ErrorDescriptorT extends ErrorDescriptor ,
46
46
> (
47
47
f : ( ) => any ,
48
- descritor : ErrorDescriptorT ,
48
+ descriptor : ErrorDescriptorT ,
49
49
messageArguments : HardhatError < ErrorDescriptorT > [ "messageArguments" ] ,
50
50
) : void {
51
51
try {
52
52
f ( ) ;
53
53
} catch ( error ) {
54
54
ensureError ( error ) ;
55
- assertIsHardhatError ( error , descritor , messageArguments ) ;
55
+ assertIsHardhatError ( error , descriptor , messageArguments ) ;
56
56
57
57
return ;
58
58
}
@@ -66,14 +66,14 @@ export function assertThrowsHardhatError<
66
66
* arguments.
67
67
*
68
68
* @param op The async operation. If it's a function, it's called and awaited.
69
- * @param descritor The error descriptor.
69
+ * @param descriptor The error descriptor.
70
70
* @param messageArguments The message arguments.
71
71
*/
72
72
export async function assertRejectsWithHardhatError <
73
73
ErrorDescriptorT extends ErrorDescriptor ,
74
74
> (
75
75
op : ( ( ) => Promise < any > ) | Promise < any > ,
76
- descritor : ErrorDescriptorT ,
76
+ descriptor : ErrorDescriptorT ,
77
77
messageArguments : HardhatError < ErrorDescriptorT > [ "messageArguments" ] ,
78
78
) : Promise < void > {
79
79
try {
@@ -84,7 +84,7 @@ export async function assertRejectsWithHardhatError<
84
84
}
85
85
} catch ( error ) {
86
86
ensureError ( error ) ;
87
- assertIsHardhatError ( error , descritor , messageArguments ) ;
87
+ assertIsHardhatError ( error , descriptor , messageArguments ) ;
88
88
89
89
return ;
90
90
}
0 commit comments