Skip to content

Commit 6e4ca38

Browse files
committed
Fix issues with switching to gulp
1 parent c36bbbc commit 6e4ca38

File tree

3 files changed

+23
-10
lines changed

3 files changed

+23
-10
lines changed

gulpfile.js

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
var gulp = require('gulp');
66
var jshint = require('gulp-jshint');
77
var karma = require('karma').server;
8+
var lodash = require('lodash');
89
var plato = require('gulp-plato');
910
var karmaConfig = __dirname + '/karma.conf.js';
1011
var paths = require('./paths');
@@ -14,27 +15,38 @@ gulp.task('complexity', function () {
1415
.pipe(plato('complexity'));
1516
});
1617

18+
var testConfig = function (options) {
19+
var travisOptions = process.env.TRAVIS &&
20+
{
21+
browsers: ['Firefox']
22+
};
23+
24+
return lodash.assign(options, travisOptions);
25+
};
26+
1727
gulp.task('test', function (done) {
18-
karma.start({
19-
configFile: karmaConfig,
20-
singleRun: true,
21-
reporters: ['progress', 'coverage', 'threshold']
22-
}, done);
28+
karma.start(testConfig(
29+
{
30+
configFile: karmaConfig,
31+
singleRun: true,
32+
reporters: ['progress', 'coverage', 'threshold']
33+
}
34+
), done);
2335
});
2436

2537
gulp.task('tdd', function (done) {
2638
gulp.watch(paths.all, ['lint']);
2739

2840
karma.start({
29-
configFile: paths.karmaConfig
41+
configFile: karmaConfig
3042
}, done);
3143
});
3244

3345
gulp.task('lint', function () {
3446
return gulp
3547
.src(paths.lint)
3648
.pipe(jshint('.jshintrc'))
37-
.pipe(jshint.reporter('default', { verbose: true }))
49+
.pipe(jshint.reporter('default', {verbose: true}))
3850
.pipe(jshint.reporter('jshint-stylish'))
3951
.pipe(jshint.reporter('fail'));
4052
});

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,14 @@
2929
"karma-jasmine": "^0.3.2",
3030
"karma-phantomjs-launcher": "^0.1.2",
3131
"karma-threshold-reporter": "^0.1.12",
32+
"lodash": "^3.5.0",
3233
"matchdep": "^0.3.0",
3334
"phantomjs": "^1.9.12",
3435
"run-browser": "^2.0.2",
3536
"tape": "^3.5.0"
3637
},
3738
"scripts": {
38-
"test": "npm run test-browserify && gulp --verbose",
39+
"test": "npm run test-browserify && gulp",
3940
"test-browserify": "run-browser test/commonjs/browserify.test.js -b",
4041
"postinstall": "./node_modules/bower/bin/bower install"
4142
},

paths.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ var bower = [
1010
];
1111
var sourceFiles = ['src/**/*.js'];
1212
var testFiles = ['test/**/*.spec.js'];
13-
var miscFiles = ['test/karma.conf.js', 'demo/**/*.js'];
13+
var miscFiles = ['demo/**/*.js'];
1414
var bumpFiles = ['package.json', 'bower.json', 'README.md', 'src/js/*.js', 'src/css/*.css'];
1515

1616
module.exports = {
1717
all: bower.concat(sourceFiles).concat(testFiles).concat(miscFiles),
1818
app: sourceFiles,
1919
bump: bumpFiles,
20-
lint: ['GruntFile.js', 'gulpfile.js', 'paths.js', 'test/**/*.test.js'].concat(sourceFiles).concat(testFiles).concat(miscFiles),
20+
lint: ['GruntFile.js', 'gulpfile.js', 'karma.conf.js', 'paths.js', 'test/**/*.test.js'].concat(sourceFiles).concat(testFiles).concat(miscFiles),
2121
test: testFiles
2222
};

0 commit comments

Comments
 (0)