0.0.13 • Published 8 years ago

gulp-waitfor v0.0.13

Weekly downloads
1
License
MIT
Repository
github
Last release
8 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

8 years ago

0.0.12

8 years ago

0.0.11

8 years ago

0.0.10

8 years ago

0.0.9

8 years ago

0.0.8

8 years ago

0.0.7

8 years ago

0.0.6

8 years ago

0.0.5

8 years ago

0.0.4

8 years ago

0.0.3

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago