From 5d67c16038628d52c4548bf7cabb582f0d45e79e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Nie=C3=9Fen?= Date: Mon, 20 Jan 2020 11:41:45 -0400 Subject: [PATCH] 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. --- doc/guides/using-internal-errors.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/guides/using-internal-errors.md b/doc/guides/using-internal-errors.md index 77eabb4ad48dec..9fac1298a1d050 100644 --- a/doc/guides/using-internal-errors.md +++ b/doc/guides/using-internal-errors.md @@ -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.