Skip to content

Commit f81a1b7

Browse files
committed
=BG= swap gulp-if for gulp-filter in javascript:unit task; plus misc. minor corrections
1 parent 0f61af4 commit f81a1b7

File tree

4 files changed

+90
-50
lines changed

4 files changed

+90
-50
lines changed

lib/test/karma.js

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
var path = require('path');
44

55
var gulp = require('gulp'),
6-
gulpIf = require('gulp-if'),
76
through = require('through2'),
87
querystring = require('querystring'),
98
childProcess = require('child_process');
@@ -33,20 +32,15 @@ var filesAppendRegex = /\/\*+\s*ANGULARITY_FILE_LIST\s*\*+\// ;
3332
* @return {stream.Through} The output of this stream is expected to contain
3433
* just one file: the augmented karma config file.
3534
*/
36-
function karmaConfig(configFileName) {
35+
function karmaCreateConfig(configFileName) {
3736
configFileName = 'karma.conf.js';
3837
var files = [];
3938

4039
function transformFn(file, encoding, done) {
4140
if (!file || !file.path) {
4241
throw 'Files must have paths';
4342
}
44-
var stream = this;
45-
//filter out all files (nothing added back to the stream)
46-
//but we save file paths for later use in the flush function
47-
if (path.extname(file.path) !== '.map') {
48-
files.push(file.path);
49-
}
43+
files.push(file.path);
5044
done();
5145
}
5246

@@ -126,6 +120,6 @@ function karmaRun(bannerWidth) {
126120
};
127121

128122
module.exports = {
129-
createConfig: karmaConfig,
123+
createConfig: karmaCreateConfig,
130124
run: karmaRun
131125
};

npm-shrinkwrap.json

Lines changed: 83 additions & 38 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
"convert-source-map": "latest",
5050
"gulp": "latest",
5151
"gulp-concat": "latest",
52-
"gulp-if": "latest",
52+
"gulp-filter": "latest",
5353
"gulp-inject": "latest",
5454
"gulp-jshint": "latest",
5555
"gulp-load-plugins": "latest",

tasks/javascript.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ var path = require('path'),
44
fs = require('fs');
55

66
var gulp = require('gulp'),
7-
gulpIf = require('gulp-if'),
7+
gulpFilter = require('gulp-filter'),
88
jshint = require('gulp-jshint'),
99
rimraf = require('gulp-rimraf'),
1010
gutil = require('gulp-util'),
@@ -127,7 +127,8 @@ gulp.task('javascript:unit', function () {
127127
.pipe(browserify
128128
.compile(80, transforms.concat(browserify.jasmineTransform('@')))
129129
.all('index.js'))
130-
.pipe(gulpIf('*.js', gulp.dest(streams.TEST)))
130+
.pipe(gulpFilter('*.js'))
131+
.pipe(gulp.dest(streams.TEST))
131132
)
132133
.pipe(karma.createConfig())
133134
.pipe(gulp.dest(streams.TEST))

0 commit comments

Comments
 (0)