diff --git a/tests/configs.test.ts b/tests/configs.test.ts index ef1f3ef54..91a269a84 100644 --- a/tests/configs.test.ts +++ b/tests/configs.test.ts @@ -14,14 +14,17 @@ import noStatements from "~/configs/no-statements"; import stylistic from "~/configs/stylistic"; import { rules } from "~/rules"; -test('Config "All" - should have all the rules', (t) => { - const allRules = Object.keys(rules); +test('Config "All" - should have all the non-deprecated rules', (t) => { + const allRules = Object.values(rules); + const allNonDeprecatedRules = allRules.filter( + (rule) => rule.meta.deprecated !== true + ); const configAllJSRules = Object.keys(all.rules ?? {}); const configAllTSRules = Object.keys(all.overrides?.[0].rules ?? {}); const configAllRules = new Set([...configAllJSRules, ...configAllTSRules]); - t.is(configAllRules.size, allRules.length); + t.is(configAllRules.size, allNonDeprecatedRules.length); }); /** diff --git a/tests/index.test.ts b/tests/index.test.ts index 48e0ce125..8dfc1558c 100644 --- a/tests/index.test.ts +++ b/tests/index.test.ts @@ -20,7 +20,7 @@ test("should have all the rules", (t) => { Object.prototype.hasOwnProperty.call(plugin, "rules"), 'The plugin\'s config object should have a "rules" property.' ); - t.assert(Object.keys(plugin.rules).length === ruleFiles.length); + t.is(ruleFiles.length, Object.keys(plugin.rules).length); }); test("should have all the configs", (t) => { @@ -28,5 +28,5 @@ test("should have all the configs", (t) => { Object.prototype.hasOwnProperty.call(plugin, "configs"), 'The plugin\'s config object should have a "configs" property.' ); - t.assert(Object.keys(plugin.configs).length === configFiles.length); + t.is(configFiles.length, Object.keys(plugin.configs).length); });