Skip to content

Commit

Permalink
test: add smoke test ensuring every config rule is one that is exported
Browse files Browse the repository at this point in the history
  • Loading branch information
keithamus committed Jul 20, 2020
1 parent a37fec5 commit e1f65a0
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/check-rules.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,15 @@ describe('smoke tests', () => {
const files = new Set(fs.readdirSync('./lib/configs').map(f => path.basename(f, path.extname(f))))
assert.deepEqual(files, exportedConfigs)
})

it('exports valid rules in each config', () => {
const exportedRules = new Set(Object.keys(config.rules))
for (const flavour in config.configs) {
for (const rule in config.configs[flavour].rules) {
if (rule.startsWith('github/')) {
assert(exportedRules.has(rule.replace(/^github\//, '')), `rule ${rule} is not a valid rule`)
}
}
}
})
})

0 comments on commit e1f65a0

Please sign in to comment.