File tree Expand file tree Collapse file tree 5 files changed +1395
-74
lines changed
Expand file tree Collapse file tree 5 files changed +1395
-74
lines changed Original file line number Diff line number Diff line change @@ -33,6 +33,14 @@ Add in [plan.json]:
3333 "time" : " 30s"
3434}
3535```
36+ #### We can make it end up failing by indicating the error message:
37+ ``` json
38+ {
39+ "id" : " wait_default" ,
40+ "time" : " 0s" ,
41+ "error" : " Caused error for testing"
42+ }
43+ ```
3644
3745[ Runnerty ] : http://www.runnerty.io
3846[ downloads-image ] : https://img.shields.io/npm/dm/@runnerty/executor-wait.svg
Original file line number Diff line number Diff line change 22
33const ms = require ( 'ms' ) ;
44
5- const Execution = global . ExecutionClass ;
5+ const Executor = global . ExecutionClass ;
66
7- class waitExecutor extends Execution {
7+ class waitExecutor extends Executor {
88 constructor ( process ) {
99 super ( process ) ;
1010 }
1111
1212 exec ( params ) {
13+ let endOptions = { end : 'end' } ;
1314 // Backward compatibility with version 1:
1415 if ( params . seconds && ! params . time ) {
15- params . time = ` ${ params . seconds } ` ;
16+ params . time = params . seconds + 's' ;
1617 }
1718 // 60s default value:
1819 if ( ! params . seconds && ! params . time ) {
19- params . time = `60s` ;
20+ params . time = '60 s' ;
21+ }
22+
23+ if ( params . error && params . error != '' ) {
24+ endOptions . end = 'error' ;
25+ endOptions . messageLog = params . error ;
26+ endOptions . err_output = params . error ;
2027 }
2128
2229 setTimeout ( ( ) => {
23- this . end ( ) ;
24- } , ms ( params . time ) || 0 ) ;
30+ this . end ( endOptions ) ;
31+ } , ms ( '' + params . time ) || 0 ) ;
2532 }
2633}
2734
You can’t perform that action at this time.
0 commit comments