From a943b3ac6bcbc2e54a9679213ee07b93bfd1f4f7 Mon Sep 17 00:00:00 2001 From: fisker Cheung Date: Thu, 21 Dec 2023 14:45:36 +0800 Subject: [PATCH] Fix tests (#2241) --- rules/shared/abbreviations.js | 2 +- test/prevent-abbreviations.mjs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/rules/shared/abbreviations.js b/rules/shared/abbreviations.js index 60b57bd238..99a02f21e0 100644 --- a/rules/shared/abbreviations.js +++ b/rules/shared/abbreviations.js @@ -180,9 +180,9 @@ module.exports.defaultReplacements = { request: true, }, res: { + resource: true, response: true, result: true, - resource: true, }, ret: { returnValue: true, diff --git a/test/prevent-abbreviations.mjs b/test/prevent-abbreviations.mjs index 76a6447fd2..015f8abd62 100644 --- a/test/prevent-abbreviations.mjs +++ b/test/prevent-abbreviations.mjs @@ -271,7 +271,7 @@ const tests = { { code: 'this.eResDir = 1', options: checkPropertiesOptions, - errors: createErrors('Please rename the property `eResDir`. Suggested names are: `errorResponseDirection`, `errorResponseDirectory`, `errorResultDirection`, ... (5 more omitted). A more descriptive name will do too.'), + errors: createErrors('Please rename the property `eResDir`. Suggested names are: `errorResourceDirection`, `errorResourceDirectory`, `errorResponseDirection`, ... (9 more omitted). A more descriptive name will do too.'), }, // All suggested names should avoid capture @@ -767,7 +767,7 @@ const tests = { }, { code: 'class Res {}', - errors: createErrors('Please rename the variable `Res`. Suggested names are: `Response_`, `Result`. A more descriptive name will do too.'), + errors: createErrors('Please rename the variable `Res`. Suggested names are: `Resource`, `Response_`, `Result`. A more descriptive name will do too.'), }, { code: 'const Err = 1;', @@ -787,7 +787,7 @@ const tests = { { code: '({Res: 1})', options: checkPropertiesOptions, - errors: createErrors('Please rename the property `Res`. Suggested names are: `Response`, `Result`. A more descriptive name will do too.'), + errors: createErrors('Please rename the property `Res`. Suggested names are: `Resource`, `Response`, `Result`. A more descriptive name will do too.'), }, {