diff --git a/index.js b/index.js index b6a46ad..a888146 100644 --- a/index.js +++ b/index.js @@ -12,7 +12,7 @@ module.exports.generateRecommendedConfig = rules => { return Object.entries(rules).reduce( (memo, [name, rule]) => rule.meta.docs.recommended - ? { ...memo, [`testcafe-community/${name}`]: "error" } + ? { ...memo, [`testcafe-community/${name}`]: rule.meta.docs.recommendedLogLevel || "error" } : memo, {} ); diff --git a/lib/rules/no-skip.js b/lib/rules/no-skip.js index 1c70762..2d182da 100644 --- a/lib/rules/no-skip.js +++ b/lib/rules/no-skip.js @@ -13,7 +13,8 @@ module.exports = { docs: { description: "Don't allow `test.skip` or `fixture.skip` to be added to the repository", category: "Mistake Prevention", - recommended: true + recommended: true, + recommendedLogLevel: "warn" }, fixable: null, schema: [] diff --git a/tests/__snapshots__/index.test.js.snap b/tests/__snapshots__/index.test.js.snap index 8c3115c..ce223c9 100644 --- a/tests/__snapshots__/index.test.js.snap +++ b/tests/__snapshots__/index.test.js.snap @@ -33,6 +33,7 @@ Object { "category": "Mistake Prevention", "description": "Don't allow \`test.skip\` or \`fixture.skip\` to be added to the repository", "recommended": true, + "recommendedLogLevel": "warn", }, "fixable": null, "schema": Array [], @@ -40,3 +41,22 @@ Object { }, } `; + +exports[`should have all the rules 2`] = ` +Object { + "recommended": Object { + "globals": Object { + "fixture": false, + "test": false, + }, + "plugins": Array [ + "testcafe-community", + ], + "rules": Object { + "testcafe-community/no-debug": "error", + "testcafe-community/no-only": "error", + "testcafe-community/no-skip": "warn", + }, + }, +} +`; diff --git a/tests/index.test.js b/tests/index.test.js index 1e76278..2c76779 100644 --- a/tests/index.test.js +++ b/tests/index.test.js @@ -2,6 +2,7 @@ const { rules, generateRecommendedConfig, configs } = require(".."); it("should have all the rules", () => { expect(rules).toMatchSnapshot(); + expect(configs).toMatchSnapshot(); }); it("should have a recommended config with recommended rules", () => {