Skip to content

Commit d65e6a5

Browse files
committed
doc: change error message testing policy
Dynamic error messages often contain important information that depends on the context, e.g., which argument caused an ERR_INVALID_ARG_TYPE, which type was expected, and which type was received. I don't think that internal breakage when changing a dynamic error message should prevent us from testing such properties properly. PR-URL: #31421 Reviewed-By: Rich Trott <[email protected]>
1 parent 24e81d7 commit d65e6a5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

doc/guides/using-internal-errors.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,8 @@ assert.strictEqual(
111111
```
112112

113113
In addition, there should also be tests which validate the use of the
114-
error based on where it is used in the codebase. For these tests, except in
115-
special cases, they should only validate that the expected code is received
114+
error based on where it is used in the codebase. If the error message is
115+
static, these tests should only validate that the expected code is received
116116
and NOT validate the message. This will reduce the amount of test change
117117
required when the message for an error changes.
118118

0 commit comments

Comments
 (0)