File tree 1 file changed +23
-0
lines changed
1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,18 @@ CustomRegistry.prototype.get = noop;
20
20
CustomRegistry . prototype . set = noop ;
21
21
CustomRegistry . prototype . tasks = noop ;
22
22
23
+ function SetNoReturnRegistry ( ) {
24
+ this . _tasks = { } ;
25
+ }
26
+ SetNoReturnRegistry . prototype . init = noop ;
27
+ SetNoReturnRegistry . prototype . get = function ( name ) {
28
+ return this . tasks [ name ] ;
29
+ } ;
30
+ SetNoReturnRegistry . prototype . set = function ( name , fn ) {
31
+ this . tasks [ name ] = fn ;
32
+ } ;
33
+ SetNoReturnRegistry . prototype . tasks = noop ;
34
+
23
35
function InvalidRegistry ( ) { }
24
36
25
37
describe ( 'registry' , function ( ) {
@@ -175,4 +187,15 @@ describe('registry', function() {
175
187
} ) ;
176
188
} ) ;
177
189
190
+ it ( 'does not require the `set` method to return a task' , function ( done ) {
191
+ var taker = new Undertaker ( ) ;
192
+ taker . registry ( new SetNoReturnRegistry ( ) ) ;
193
+ taker . task ( 'test' , noop ) ;
194
+ taker . on ( 'start' , function ( data ) {
195
+ expect ( data . name ) . to . equal ( 'test' ) ;
196
+ done ( ) ;
197
+ } ) ;
198
+ taker . series ( 'test' ) ( ) ;
199
+ } ) ;
200
+
178
201
} ) ;
You can’t perform that action at this time.
0 commit comments