Skip to content

Conditional Steps

Compare
Choose a tag to compare
@NathanGRomano NathanGRomano released this 07 Aug 17:35
· 4 commits to master since this release

Stairs#step(title:String, exclude:Boolean, fn:Function)

Conditionally adds a step.

s.step('query api', options.skipQuery, function ($, next) {
  http.get($.url, function (res) {
    $.body = '';
    res.on('data', function (chunk) { $.body = $.body + chunk; });
    res.on('end', next);
    res.on('error', next);
  });
});

The "query api" step will not be added if options.skipQuery is true.