0.0.13 • Published 10 years ago

gulp-waitfor v0.0.13

Weekly downloads
1
License
MIT
Repository
github
Last release
10 years ago

gulp-waitfor

A gulp task that waits until a condition is met or until timeout.

Example

The following gulp example will start a wiremock server and delay the jasmine tests until wiremock is finished booting.

var gulp = require('gulp');
var waitFor = require('gulp-waitfor');
var request = require('request');

gulp.task('run-e2e', function () {
    return gulp
        .exec('java -jar ./lib/wiremock-standalone.jar --your-options')
        .pipe(waitFor(function (cb) {
            request('http://localhost:1235/service/your-mock-service', function (error, response) {
                cb(!error && response.statusCode === 200);
            });
        }))
        .pipe(... /* run jasmine tests or simply got to the next task */);
});

Options

There are two ways to invoke gulp-waitfor:

Basic:

waitFor(function(cb) { /* cb(condition satisfied boolean)  */}, [timeoutMs], [intervalMs])

Config object:

waitFor({
  before: function() { },
  condition: function(cb) { /* cb(condition satisfied boolean)  */},
  after: function(succes) { },
  interval: 500ms, // default is 500
  timeout: 60000ms, // default is 1 minute
  verbose: false, // default is true (false silences logging)
})
0.0.13

10 years ago

0.0.12

10 years ago

0.0.11

10 years ago

0.0.10

10 years ago

0.0.9

10 years ago

0.0.8

10 years ago

0.0.7

10 years ago

0.0.6

10 years ago

0.0.5

10 years ago

0.0.4

10 years ago

0.0.3

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago