Skip to content

Commit 309f37f

Browse files
committed
gulp: run lint over test scripts
1 parent abe01f1 commit 309f37f

File tree

4 files changed

+11
-4
lines changed

4 files changed

+11
-4
lines changed

.eslintignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
dist/
2+
gulp/

gulp/lint.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ function isFixed(file) {
1313

1414
function runLinter(tryToFix) {
1515
var codePath = path.join(conf.paths.src, 'app');
16-
return gulp.src(path.join(codePath, '**/*.js'))
16+
return gulp.src([path.join(codePath, '**/*.js'),
17+
path.join(conf.paths.test, '**/*.js')])
1718
.pipe($.eslint({ fix: tryToFix }))
1819
.pipe($.eslint.format())
1920
.pipe($.if(isFixed, gulp.dest(codePath)))

gulp/test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ gulp.task('test:unit', function (done) {
2828
// upgrade to phantomjs2 is complete
2929
'node_modules/es5-shim/es5-shim.js',
3030
src_files,
31-
'test/karma/**/*.js'),
31+
path.join(conf.paths.test, '/karma/**/*.js')),
3232
singleRun: true
3333
});
3434

test/karma/chat.service.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1+
/*global describe,beforeEach,it,sinon,expect,module,inject */
2+
13
describe('Service: ChatService', function () {
4+
'use strict';
5+
26
function makeTestMessage() {
37
// The chat service may mutate the received object, so use a
48
// factory like this to make the tests are truly isolated
@@ -25,8 +29,8 @@ describe('Service: ChatService', function () {
2529

2630
beforeEach(function () {
2731
mockWebsocket = sinon.stub({
28-
onJSON: function (name, callback) {},
29-
emitJSON: function (name, data, callback) {}
32+
onJSON: function () {},
33+
emitJSON: function () {}
3034
});
3135

3236
mockLobbyService = sinon.stub({

0 commit comments

Comments
 (0)