File tree Expand file tree Collapse file tree 1 file changed +8
-16
lines changed Expand file tree Collapse file tree 1 file changed +8
-16
lines changed Original file line number Diff line number Diff line change @@ -5,27 +5,19 @@ const BaseRule = require('../lib/rule')
5
5
6
6
test ( 'Base Rule Test' , ( t ) => {
7
7
t . test ( 'No id param' , ( tt ) => {
8
- try {
8
+ tt . throws ( ( ) => {
9
9
new BaseRule ( )
10
- tt . fail ( 'This should fail' )
11
- } catch ( err ) {
12
- tt . equal ( err . message ,
13
- 'Rule must have an id' ,
14
- 'Should have error message about id' )
15
- tt . end ( )
16
- }
10
+ } , 'Rule must have an id' )
11
+
12
+ tt . end ( )
17
13
} )
18
14
19
15
t . test ( 'No validate function' , ( tt ) => {
20
- try {
16
+ tt . throws ( ( ) => {
21
17
new BaseRule ( { id : 'test-rule' } )
22
- tt . fail ( 'This should fail' )
23
- } catch ( err ) {
24
- tt . equal ( err . message ,
25
- 'Rule must have validate function' ,
26
- 'Should have error message about validate function' )
27
- tt . end ( )
28
- }
18
+ } , 'Rule must have validate function' )
19
+
20
+ tt . end ( )
29
21
} )
30
22
31
23
t . end ( )
You can’t perform that action at this time.
0 commit comments