File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -1243,11 +1243,11 @@ assert.throws(
1243
1243
(err ) => {
1244
1244
assert (err instanceof Error );
1245
1245
assert (/ value/ .test (err));
1246
- // Returning anything from validation functions besides `true` is not
1247
- // recommended. By doing that , it's not clear what part of the validation
1248
- // failed. Instead, throw an error about the specific validation that failed
1249
- // (as done in this example) and add as much helpful debugging information
1250
- // to that error as possible.
1246
+ // Avoid returning anything from validation functions besides `true`.
1247
+ // Otherwise , it's not clear what part of the validation failed. Instead,
1248
+ // throw an error about the specific validation that failed (as done in this
1249
+ // example) and add as much helpful debugging information to that error as
1250
+ // possible.
1251
1251
return true ;
1252
1252
},
1253
1253
' unexpected error'
@@ -1294,8 +1294,8 @@ assert.throws(throwingFirst, /Second$/);
1294
1294
// AssertionError [ERR_ASSERTION]
1295
1295
```
1296
1296
1297
- Due to the confusing notation, it is recommended not to use a string as the
1298
- second argument. This might lead to difficult-to-spot errors .
1297
+ Due to the confusing error-prone notation, avoid a string as the second
1298
+ argument.
1299
1299
1300
1300
[ `AssertionError` ] : #assert_class_assert_assertionerror
1301
1301
[ `Class` ] : https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes
You can’t perform that action at this time.
0 commit comments