Skip to content

Commit 1a65bf1

Browse files
authoredDec 21, 2020
feat(server): remove deprecated static methods (#3595)
BREAKING CHANGE: Deprecated `require('karma').server.start()` and `require('karma').Server.start()` variants were removed from the public API. Instead use canonical form: ``` const { Server } = require('karma'); const server = new Server(); server.start(); ```
1 parent fb76ed6 commit 1a65bf1

File tree

2 files changed

+1
-19
lines changed

2 files changed

+1
-19
lines changed
 

‎lib/index.js

+1-14
Original file line numberDiff line numberDiff line change
@@ -7,25 +7,12 @@ const stopper = require('./stopper')
77
const launcher = require('./launcher')
88
const cfg = require('./config')
99

10-
// TODO: remove in 1.0
11-
const oldServer = {
12-
start: function (cliOptions, done) {
13-
console.error('WARN `start` method is deprecated since 0.13. It will be removed in 0.14. Please use \n' +
14-
' server = new Server(config, [done])\n' +
15-
' server.start()\n' +
16-
'instead.')
17-
const server = new Server(cliOptions, done)
18-
server.start()
19-
}
20-
}
21-
2210
module.exports = {
2311
constants: constants,
2412
VERSION: constants.VERSION,
2513
Server: Server,
2614
runner: runner,
2715
stopper: stopper,
2816
launcher: launcher,
29-
config: { parseConfig: cfg.parseConfig }, // lets start with only opening up the `parseConfig` api
30-
server: oldServer
17+
config: { parseConfig: cfg.parseConfig } // lets start with only opening up the `parseConfig` api
3118
}

‎lib/server.js

-5
Original file line numberDiff line numberDiff line change
@@ -450,11 +450,6 @@ class Server extends KarmaEventEmitter {
450450
stop () {
451451
return this.emitAsync('stop')
452452
}
453-
454-
static start (cliOptions, done) {
455-
console.warn('Deprecated static method to be removed in v3.0')
456-
return new Server(cliOptions, done).start()
457-
}
458453
}
459454

460455
Server.prototype._start.$inject = ['config', 'launcher', 'preprocess', 'fileList', 'capturedBrowsers', 'executor', 'done']

0 commit comments

Comments
 (0)
Please sign in to comment.