Skip to content

Commit

Permalink
doc: change error message testing policy
Browse files Browse the repository at this point in the history
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 <rtrott@gmail.com>
  • Loading branch information
tniessen authored and codebytere committed Mar 15, 2020
1 parent 98708a5 commit 25bb558
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions doc/guides/using-internal-errors.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ assert.strictEqual(
```

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

Expand Down

0 comments on commit 25bb558

Please sign in to comment.