Skip to content

Commit c80a316

Browse files
committed
chore: update dependencies
- Update dependencies as part of process to drop support for versions of Node.js below 4 Closes karma-runner#1812 Closes karma-runner#2688
1 parent 2a847c2 commit c80a316

12 files changed

+84
-53
lines changed

lib/config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ var Config = function () {
284284
this.LOG_DEBUG = constant.LOG_DEBUG
285285

286286
this.set = function (newConfig) {
287-
_.merge(config, newConfig, function (obj, src) {
287+
_.mergeWith(config, newConfig, function (obj, src) {
288288
// Overwrite arrays to keep consistent with #283
289289
if (_.isArray(src)) {
290290
return src

package.json

+9-7
Original file line numberDiff line numberDiff line change
@@ -340,8 +340,8 @@
340340
"graceful-fs": "^4.1.2",
341341
"http-proxy": "^1.13.0",
342342
"isbinaryfile": "^3.0.0",
343-
"lodash": "^3.8.0",
344-
"log4js": "^0.6.31",
343+
"lodash": "^4.17.4",
344+
"log4js": "^1.1.1",
345345
"mime": "^1.3.4",
346346
"minimatch": "^3.0.2",
347347
"optimist": "^0.6.1",
@@ -363,12 +363,14 @@
363363
"chai-as-promised": "^6.0.0",
364364
"chai-subset": "^1.2.2",
365365
"coffee-script": "^1.12.4",
366-
"cucumber": "^1.2.0",
366+
"cucumber": "^2.0.0-rc.9",
367367
"eslint": "^3.15.0",
368-
"eslint-config-standard": "^7.0.0",
368+
"eslint-config-standard": "^10.2.1",
369+
"eslint-plugin-import": "^2.2.0",
370+
"eslint-plugin-node": "^4.2.2",
369371
"eslint-plugin-promise": "^3.4.2",
370-
"eslint-plugin-react": "^6.10.0",
371-
"eslint-plugin-standard": "^2.0.1",
372+
"eslint-plugin-react": "^7.0.0",
373+
"eslint-plugin-standard": "^3.0.1",
372374
"grunt": "^1.0.0",
373375
"grunt-auto-release": "^0.0.7",
374376
"grunt-browserify": "^5.0.0",
@@ -414,7 +416,7 @@
414416
"proxyquire": "^1.7.11",
415417
"qunitjs": "^2.1.1",
416418
"requirejs": "^2.1.20",
417-
"sinon": "^1.17.5",
419+
"sinon": "^2.2.0",
418420
"sinon-chai": "^2.7.0",
419421
"supertest": "^3.0.0",
420422
"timer-shim": "^0.3.0",

test/unit/completion.spec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ describe('completion', () => {
1515
}
1616

1717
beforeEach(() => {
18-
sinon.stub(console, 'log', (msg) => completion.push(msg))
18+
sinon.stub(console, 'log').callsFake((msg) => completion.push(msg))
1919
completion = []
2020
})
2121

test/unit/config.spec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
var loadFile = require('mocks').loadFile
21
import path from 'path'
2+
var loadFile = require('mocks').loadFile
33
var helper = require('../../lib/helper')
44
var logger = require('../../lib/logger.js')
55

test/unit/file-list.spec.js

+44-15
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import config from '../../lib/config'
1313
var patterns = (...strings) => strings.map((str) => new config.Pattern(str))
1414

1515
function pathsFrom (files) {
16-
return _.pluck(from(files), 'path')
16+
return _.map(from(files), 'path')
1717
}
1818

1919
function findFile (path, files) {
@@ -279,7 +279,7 @@ describe('FileList', () => {
279279

280280
it('cancels refreshs', () => {
281281
var checkResult = (files) => {
282-
expect(_.pluck(files.served, 'path')).to.contain('/some/a.js', '/some/b.js', '/some/c.js')
282+
expect(_.map(files.served, 'path')).to.contain('/some/a.js', '/some/b.js', '/some/c.js')
283283
}
284284

285285
var p1 = list.refresh().then(checkResult)
@@ -486,9 +486,15 @@ describe('FileList', () => {
486486
return list.refresh().then(() => {
487487
modified.reset()
488488

489-
return list.addFile('/some/d.js').then(() => {
490-
expect(modified).to.have.been.calledOnce
491-
})
489+
return list.addFile('/some/d.js')
490+
.then(() => new Promise((resolve) => {
491+
_.defer(() => {
492+
resolve()
493+
})
494+
}))
495+
.then(() => {
496+
expect(modified).to.have.been.calledOnce
497+
})
492498
})
493499
})
494500

@@ -569,10 +575,16 @@ describe('FileList', () => {
569575
mockFs._touchFile('/some/b.js', '2020-01-01')
570576
modified.reset()
571577

572-
return list.changeFile('/some/b.js').then((files) => {
573-
expect(modified).to.have.been.calledOnce
574-
expect(findFile('/some/b.js', files.served).mtime).to.be.eql(new Date('2020-01-01'))
575-
})
578+
return list.changeFile('/some/b.js')
579+
.then((files) => new Promise((resolve) => {
580+
_.defer(() => {
581+
resolve(files)
582+
})
583+
}))
584+
.then((files) => {
585+
expect(modified).to.have.been.calledOnce
586+
expect(findFile('/some/b.js', files.served).mtime).to.be.eql(new Date('2020-01-01'))
587+
})
576588
})
577589
})
578590

@@ -662,7 +674,11 @@ describe('FileList', () => {
662674
return list.refresh().then((files) => {
663675
modified.reset()
664676
return list.removeFile('/some/a.js')
665-
}).then((files) => {
677+
}).then((files) => new Promise((resolve) => {
678+
_.defer(() => {
679+
resolve(files)
680+
})
681+
})).then((files) => {
666682
expect(pathsFrom(files.served)).to.be.eql([
667683
'/some/b.js',
668684
'/a.txt'
@@ -751,7 +767,7 @@ describe('FileList', () => {
751767
})
752768
})
753769

754-
it('waits while file preprocessing, if the file was deleted and immediately added', (done) => {
770+
it('waits while file preprocessing, if the file was deleted and immediately added', () => {
755771
list = new List(patterns('/a.*'), [], emitter, preprocess, 100)
756772

757773
list.refresh().then((files) => {
@@ -766,12 +782,25 @@ describe('FileList', () => {
766782

767783
expect(preprocess).to.not.have.been.called
768784

769-
emitter.once('file_list_modified', () => _.defer(() => {
770-
expect(preprocess).to.have.been.calledOnce
771-
done()
772-
}))
785+
var promise = new Promise((resolve) => {
786+
emitter.once('file_list_modified', () => _.defer(() => {
787+
resolve()
788+
}))
789+
})
773790

774791
clock.tick(2)
792+
793+
return promise
794+
.then(() => {
795+
return new Promise((resolve) => {
796+
_.defer(() => {
797+
resolve()
798+
})
799+
})
800+
})
801+
.then(() => {
802+
expect(preprocess).to.have.been.calledOnce
803+
})
775804
})
776805
})
777806
})

test/unit/launcher.spec.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ var stubPromise = (obj, method, stubAction) => {
1010
obj[method].resolve = resolve
1111
})
1212

13-
sinon.stub(obj, method, () => {
13+
sinon.stub(obj, method).callsFake(() => {
1414
if (stubAction) stubAction()
1515

1616
return promise
@@ -30,7 +30,7 @@ class FakeBrowser {
3030

3131
baseBrowserDecorator(this)
3232
FakeBrowser._instances.push(this)
33-
sinon.stub(this, 'start', () => {
33+
sinon.stub(this, 'start').callsFake(() => {
3434
this.state = this.STATE_BEING_CAPTURED
3535
this._done()
3636
})
@@ -52,7 +52,7 @@ class ScriptBrowser {
5252

5353
baseBrowserDecorator(this)
5454
ScriptBrowser._instances.push(this)
55-
sinon.stub(this, 'start', () => {
55+
sinon.stub(this, 'start').callsFake(() => {
5656
this.state = this.STATE_BEING_CAPTURED
5757
this._done()
5858
})

test/unit/logger.spec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ describe('logger', () => {
1515
filename: 'test/unit/test.log'
1616
}])
1717

18-
expect(m.log4js.appenders).to.have.keys(['console', 'file'])
18+
expect(m.log4js.appenders).to.have.keys(['console', 'file', 'stdout'])
1919
})
2020
})
2121
})

test/unit/middleware/runner.spec.js

+9-9
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ describe('middleware.runner', () => {
7070

7171
it('should trigger test run and stream the reporter', (done) => {
7272
capturedBrowsers.add(new Browser())
73-
sinon.stub(capturedBrowsers, 'areAllReady', () => true)
73+
sinon.stub(capturedBrowsers, 'areAllReady').callsFake(() => true)
7474

7575
response.once('end', () => {
7676
expect(nextSpy).to.not.have.been.called
@@ -86,7 +86,7 @@ describe('middleware.runner', () => {
8686

8787
it('should set the empty to 0 if empty results', (done) => {
8888
capturedBrowsers.add(new Browser())
89-
sinon.stub(capturedBrowsers, 'areAllReady', () => true)
89+
sinon.stub(capturedBrowsers, 'areAllReady').callsFake(() => true)
9090

9191
response.once('end', () => {
9292
expect(nextSpy).to.not.have.been.called
@@ -102,7 +102,7 @@ describe('middleware.runner', () => {
102102

103103
it('should set the empty to 1 if successful tests', (done) => {
104104
capturedBrowsers.add(new Browser())
105-
sinon.stub(capturedBrowsers, 'areAllReady', () => true)
105+
sinon.stub(capturedBrowsers, 'areAllReady').callsFake(() => true)
106106

107107
response.once('end', () => {
108108
expect(nextSpy).to.not.have.been.called
@@ -118,7 +118,7 @@ describe('middleware.runner', () => {
118118

119119
it('should set the empty to 1 if failed tests', (done) => {
120120
capturedBrowsers.add(new Browser())
121-
sinon.stub(capturedBrowsers, 'areAllReady', () => true)
121+
sinon.stub(capturedBrowsers, 'areAllReady').callsFake(() => true)
122122

123123
response.once('end', () => {
124124
expect(nextSpy).to.not.have.been.called
@@ -215,7 +215,7 @@ describe('middleware.runner', () => {
215215
clientArgsRuns.forEach(function (run) {
216216
it(run.desc, (done) => {
217217
capturedBrowsers.add(new Browser())
218-
sinon.stub(capturedBrowsers, 'areAllReady', () => true)
218+
sinon.stub(capturedBrowsers, 'areAllReady').callsFake(() => true)
219219
if (run.existingConfig) {
220220
config = _.merge(config, {client: {args: run.existingConfig}})
221221
}
@@ -242,7 +242,7 @@ describe('middleware.runner', () => {
242242

243243
it('should refresh explicit files if specified', (done) => {
244244
capturedBrowsers.add(new Browser())
245-
sinon.stub(capturedBrowsers, 'areAllReady', () => true)
245+
sinon.stub(capturedBrowsers, 'areAllReady').callsFake(() => true)
246246
sinon.stub(fileListMock, 'refresh')
247247
sinon.stub(fileListMock, 'addFile')
248248
sinon.stub(fileListMock, 'changeFile')
@@ -276,7 +276,7 @@ describe('middleware.runner', () => {
276276

277277
it('should wait for refresh to finish if applicable before scheduling execution', (done) => {
278278
capturedBrowsers.add(new Browser())
279-
sinon.stub(capturedBrowsers, 'areAllReady', () => true)
279+
sinon.stub(capturedBrowsers, 'areAllReady').callsFake(() => true)
280280

281281
var res = null
282282
var fileListPromise = new Promise((resolve, reject) => {
@@ -303,7 +303,7 @@ describe('middleware.runner', () => {
303303

304304
it('should schedule execution if no refresh', (done) => {
305305
capturedBrowsers.add(new Browser())
306-
sinon.stub(capturedBrowsers, 'areAllReady', () => true)
306+
sinon.stub(capturedBrowsers, 'areAllReady').callsFake(() => true)
307307

308308
sinon.spy(fileListMock, 'refresh')
309309
sinon.stub(executor, 'schedule')
@@ -331,7 +331,7 @@ describe('middleware.runner', () => {
331331
config.autoWatch = true
332332

333333
capturedBrowsers.add(new Browser())
334-
sinon.stub(capturedBrowsers, 'areAllReady', () => true)
334+
sinon.stub(capturedBrowsers, 'areAllReady').callsFake(() => true)
335335

336336
sinon.spy(fileListMock, 'refresh')
337337
sinon.stub(executor, 'schedule')

test/unit/preprocessor.spec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ describe('preprocessor', () => {
99
var mockFs
1010
var emitterSetting
1111
// mimic first few bytes of a pdf file
12-
var binarydata = new Buffer([0x25, 0x50, 0x44, 0x66, 0x46, 0x00])
12+
var binarydata = new Buffer([0x25, 0x50, 0x44, 0x66, 0x46, 0x00]) // eslint-disable-line node/no-deprecated-api
1313

1414
beforeEach(() => {
1515
mockFs = mocks.fs.create({

test/unit/runner.spec.js

+12-12
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ describe('runner', () => {
1313
var EXIT = constant.EXIT_CODE
1414

1515
it('should return 0 exit code if present in the buffer', () => {
16-
var result = m.parseExitCode(new Buffer(`something\nfake${EXIT}10`))
16+
var result = m.parseExitCode(new Buffer(`something\nfake${EXIT}10`)) // eslint-disable-line node/no-deprecated-api
1717
expect(result.exitCode).to.equal(0)
1818
})
1919

2020
it('should remove the exit code part of the returned buffer', () => {
21-
var buffer = new Buffer(`some${EXIT}01`)
21+
var buffer = new Buffer(`some${EXIT}01`) // eslint-disable-line node/no-deprecated-api
2222
var result = m.parseExitCode(buffer)
2323

2424
expect(buffer.toString()).to.equal(`some${EXIT}01`)
@@ -27,7 +27,7 @@ describe('runner', () => {
2727

2828
it('should not touch buffer without exit code and return default', () => {
2929
var msg = 'some nice \n messgae {}'
30-
var buffer = new Buffer(msg)
30+
var buffer = new Buffer(msg) // eslint-disable-line node/no-deprecated-api
3131
var result = m.parseExitCode(buffer, 10)
3232

3333
expect(result.buffer.toString()).to.equal(msg)
@@ -52,21 +52,21 @@ describe('runner', () => {
5252
})
5353

5454
it('should parse any single digit exit code', () => {
55-
expect(m.parseExitCode(new Buffer(`something\nfake${EXIT}01`)).exitCode).to.equal(1)
56-
expect(m.parseExitCode(new Buffer(`something\nfake${EXIT}17`)).exitCode).to.equal(7)
55+
expect(m.parseExitCode(new Buffer(`something\nfake${EXIT}01`)).exitCode).to.equal(1) // eslint-disable-line node/no-deprecated-api
56+
expect(m.parseExitCode(new Buffer(`something\nfake${EXIT}17`)).exitCode).to.equal(7) // eslint-disable-line node/no-deprecated-api
5757
})
5858

5959
it('should return exit code 0 if failOnEmptyTestSuite is false and and non-empty int is 0', () => {
60-
expect(m.parseExitCode(new Buffer(`something\nfake${EXIT}01`), undefined, false).exitCode).to.equal(0)
60+
expect(m.parseExitCode(new Buffer(`something\nfake${EXIT}01`), undefined, false).exitCode).to.equal(0) // eslint-disable-line node/no-deprecated-api
6161
})
6262

6363
it('should return exit code if failOnEmptyTestSuite is true', () => {
64-
expect(m.parseExitCode(new Buffer(`something\nfake${EXIT}00`), undefined, true).exitCode).to.equal(0)
65-
expect(m.parseExitCode(new Buffer(`something\nfake${EXIT}01`), undefined, true).exitCode).to.equal(1)
66-
expect(m.parseExitCode(new Buffer(`something\nfake${EXIT}07`), undefined, true).exitCode).to.equal(7)
67-
expect(m.parseExitCode(new Buffer(`something\nfake${EXIT}10`), undefined, true).exitCode).to.equal(0)
68-
expect(m.parseExitCode(new Buffer(`something\nfake${EXIT}11`), undefined, true).exitCode).to.equal(1)
69-
expect(m.parseExitCode(new Buffer(`something\nfake${EXIT}17`), undefined, true).exitCode).to.equal(7)
64+
expect(m.parseExitCode(new Buffer(`something\nfake${EXIT}00`), undefined, true).exitCode).to.equal(0) // eslint-disable-line node/no-deprecated-api
65+
expect(m.parseExitCode(new Buffer(`something\nfake${EXIT}01`), undefined, true).exitCode).to.equal(1) // eslint-disable-line node/no-deprecated-api
66+
expect(m.parseExitCode(new Buffer(`something\nfake${EXIT}07`), undefined, true).exitCode).to.equal(7) // eslint-disable-line node/no-deprecated-api
67+
expect(m.parseExitCode(new Buffer(`something\nfake${EXIT}10`), undefined, true).exitCode).to.equal(0) // eslint-disable-line node/no-deprecated-api
68+
expect(m.parseExitCode(new Buffer(`something\nfake${EXIT}11`), undefined, true).exitCode).to.equal(1) // eslint-disable-line node/no-deprecated-api
69+
expect(m.parseExitCode(new Buffer(`something\nfake${EXIT}17`), undefined, true).exitCode).to.equal(7) // eslint-disable-line node/no-deprecated-api
7070
})
7171
})
7272
})

test/unit/server.spec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ describe('server', () => {
230230
fileListOnResolve()
231231

232232
function mockProcess (process) {
233-
sinon.stub(process, 'kill', (pid, ev) => process.emit(ev))
233+
sinon.stub(process, 'kill').callsFake((pid, ev) => process.emit(ev))
234234
}
235235
})
236236
})

test/unit/web-server.spec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
require('core-js')
1+
import 'core-js'
22
import {EventEmitter} from 'events'
33
import request from 'supertest'
44
import di from 'di'

0 commit comments

Comments
 (0)