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')
55
66test ( 'Base Rule Test' , ( t ) => {
77 t . test ( 'No id param' , ( tt ) => {
8- try {
8+ tt . throws ( ( ) => {
99 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 ( )
1713 } )
1814
1915 t . test ( 'No validate function' , ( tt ) => {
20- try {
16+ tt . throws ( ( ) => {
2117 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 ( )
2921 } )
3022
3123 t . end ( )
You can’t perform that action at this time.
0 commit comments