gulp-galen
Advanced tools
Comparing version 1.0.0 to 1.0.2
@@ -7,3 +7,3 @@ var spawn = require("child_process").spawn, | ||
return function(options) { | ||
if (options == null) { | ||
if (typeof(options) === 'undefined') { | ||
options = {}; | ||
@@ -33,5 +33,8 @@ } | ||
return through(function(file) { | ||
var stream = this; | ||
if (!opt.parallel) { | ||
// Prevent paralell execution | ||
this.pause(); | ||
stream.pause(); | ||
} | ||
@@ -55,8 +58,9 @@ | ||
if (code === 0) { | ||
return this.emit('data', file); | ||
stream.emit('data', file); | ||
stream.resume(); | ||
} else { | ||
throw new Error("Test '" + file.path + "' failed!"); | ||
stream.emit('error', new Error("Test '" + file.path + "' failed!")); | ||
} | ||
}).on("error", function(err) { | ||
throw new Error("Could not start galen. Galen ('" + galenPath + "') not found?"); | ||
stream.emit('error', new Error("Could not start galen. Galen ('" + galenPath + "') not found?")); | ||
}); | ||
@@ -63,0 +67,0 @@ }); |
{ | ||
"version": "1.0.0", | ||
"version": "1.0.2", | ||
"name": "gulp-galen", | ||
@@ -9,2 +9,7 @@ "description": "A gulp-plugin for using the galen-framework within a gulp-based build toolchain", | ||
}, | ||
"devDependencies": { | ||
"galenframework-cli": "^2.1.2", | ||
"event-stream": "^3.3.2", | ||
"gulp": "^3.9.0" | ||
}, | ||
"engines": { | ||
@@ -21,4 +26,7 @@ "node": ">=0.8.0" | ||
}, | ||
"author": "Galeria Kaufhof GmbH", | ||
"scripts": { | ||
"test": "jshint *.js lib/*.js test/*.js && mocha" | ||
}, | ||
"author": "GALERIA Kaufhof GmbH", | ||
"license": "MIT" | ||
} |
@@ -7,12 +7,46 @@ # gulp-galen | ||
npm install gulp-galen | ||
```Shell | ||
npm install gulp-galen | ||
``` | ||
Galen needs to be installed on the system (it isn't bundleled with `npm install --production`). You | ||
could do this with: | ||
Galen needs to be installed on the system. You could do this with: | ||
```Shell | ||
npm install -g galenframework-cli | ||
``` | ||
npm install -g galenframework-cli | ||
If this doesn't install galen to `/usr/local/bin/galen` use the `galenPath` option to specify the | ||
correct path: | ||
```JavaScript | ||
gulpGalen.check({galenPath: '/some/other/path/to/galen'}) | ||
``` | ||
### Bundling Galen | ||
When you're **not** using the `--production` mode you can use the bundeled galen by using the | ||
`galenPath` option: | ||
```JavaScript | ||
gulpGalen.check({galenPath: './node_modules/gulp-galen/node_modules/.bin/galen'}) | ||
``` | ||
Another alternative it to add `galenframework-cli` into you project's dependencies: | ||
```Shell | ||
npm install galenframework-cli --save | ||
``` | ||
Then you could use the `galenPath` option as follows: | ||
```JavaScript | ||
gulpGalen.check({galenPath: './node_modules/.bin/galen'}) | ||
``` | ||
## Usage | ||
var gulpGalen = require('gulp-galen'); | ||
```JavaScript | ||
var gulpGalen = require('gulp-galen'); | ||
``` | ||
@@ -52,10 +86,22 @@ This provides two gulp stream constructors: | ||
## Excamples | ||
## Examples | ||
Run some gspec against google.com: | ||
gulp.src('/**/*.gspec').pipe(gulpGalen.check(url: 'https://www.google.com')); | ||
```JavaScript | ||
var gulpGalen = require('gulp-galen'); | ||
gulp.task("test:galen", function() { | ||
gulp.src('test/galen/**/*.gspec').pipe(gulpGalen.check(url: 'https://www.google.com')); | ||
}); | ||
``` | ||
Run some JavaScript based test suites: | ||
gulp.src('/test/galen/*.js').pipe(gukpGalen.test()); | ||
```JavaScript | ||
var gulpGalen = require('gulp-galen'); | ||
gulp.task("test:galen", function() { | ||
gulp.src('test/galen/**/*.js').pipe(gukpGalen.test()); | ||
}); | ||
``` |
8678
10
96
106
3