-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Autogenerate recommended config
Merge pull request #4 from nickmccurdy/autogenerate-recommended-config
- Loading branch information
Showing
5 changed files
with
62 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,42 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`should have all the rules 1`] = `Object {}`; | ||
exports[`should have all the rules 1`] = ` | ||
Object { | ||
"prefer-checked": Object { | ||
"create": [Function], | ||
"meta": Object { | ||
"docs": Object { | ||
"category": "jest-dom", | ||
"description": "prefer toBeChecked over checking attributes", | ||
"recommended": true, | ||
"url": "prefer-checked", | ||
}, | ||
"fixable": "code", | ||
}, | ||
}, | ||
"prefer-enabled-disabled": Object { | ||
"create": [Function], | ||
"meta": Object { | ||
"docs": Object { | ||
"category": "jest-dom", | ||
"description": "prefer toBeDisabled or toBeEnabled over checking attributes", | ||
"recommended": true, | ||
"url": "prefer-enabled-disabled", | ||
}, | ||
"fixable": "code", | ||
}, | ||
}, | ||
"prefer-required": Object { | ||
"create": [Function], | ||
"meta": Object { | ||
"docs": Object { | ||
"category": "jest-dom", | ||
"description": "prefer toBeRequired over checking properties", | ||
"recommended": true, | ||
"url": "prefer-required", | ||
}, | ||
"fixable": "code", | ||
}, | ||
}, | ||
} | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,14 @@ | ||
const { rules } = require('../lib/index'); | ||
const { rules, generateRecommendedConfig, configs } = require('../lib/index'); | ||
|
||
it('should have all the rules', () => { | ||
expect(rules).toMatchSnapshot(); | ||
}); | ||
|
||
it('should have a recommended config with recommended rules', () => { | ||
expect( | ||
generateRecommendedConfig({ | ||
good: { meta: { docs: { recommended: true } } }, | ||
bad: { meta: { docs: { recommended: false } } }, | ||
}) | ||
).toEqual({ good: 'error' }); | ||
}); |