Skip to content

Commit

Permalink
fix: changed skip to warn
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben Monro committed May 14, 2020
1 parent 9125239 commit 68c7d49
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 2 deletions.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
{}
);
Expand Down
3 changes: 2 additions & 1 deletion lib/rules/no-skip.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: []
Expand Down
20 changes: 20 additions & 0 deletions tests/__snapshots__/index.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,30 @@ 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 [],
},
},
}
`;

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",
},
},
}
`;
1 change: 1 addition & 0 deletions tests/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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", () => {
Expand Down

0 comments on commit 68c7d49

Please sign in to comment.