Skip to content

Commit

Permalink
squash: use tap.throws instead of try/catch
Browse files Browse the repository at this point in the history
  • Loading branch information
lholmquist committed Aug 5, 2019
1 parent ef78ecf commit 4c45b9f
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions test/rules-test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
'use strict'

const test = require('tap').test
const BaseRule = require('../lib/rule')

test('Base Rule Test', (t) => {
t.test('No id param', (tt) => {
tt.throws(() => {
new BaseRule()
}, 'Rule must have an id')

tt.end()
})

t.test('No validate function', (tt) => {
tt.throws(() => {
new BaseRule({id: 'test-rule'})
}, 'Rule must have validate function')

tt.end()
})

t.end()
})

0 comments on commit 4c45b9f

Please sign in to comment.