Skip to content

Commit 648b357

Browse files
committed
fix: restore backward compatibility for [email protected]
This adds `start` method back to the object exported by `lib/server.js`. Closes 1500
1 parent c483d18 commit 648b357

2 files changed

Lines changed: 14 additions & 5 deletions

File tree

lib/index.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ var launcher = require('./launcher')
77

88
// TODO: remove in 1.0
99
var oldServer = {
10-
start: function () {
11-
throw new Error(
12-
'The api interface has changed. Please use \n' +
10+
start: function (cliOptions, done) {
11+
console.error('WARN `start` method is deprecated since 0.13. It will be removed in 0.14. Please use \n' +
1312
' server = new Server(config, [done])\n' +
1413
' server.start()\n' +
15-
'instead.'
16-
)
14+
'instead.')
15+
var server = new Server(cliOptions, done)
16+
server.start()
1717
}
1818
}
1919

lib/server.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,15 @@ Server.prototype.start = function () {
9292
this._injector.invoke(this._start, this)
9393
}
9494

95+
/**
96+
* Backward-compatibility with karma-intellij bundled with WebStorm.
97+
* Deprecated since version 0.13, to be removed in 0.14
98+
*/
99+
Server.start = function (cliOptions, done) {
100+
var server = new Server(cliOptions, done)
101+
server.start()
102+
}
103+
95104
// Get properties from the injector
96105
//
97106
// token - String

0 commit comments

Comments
 (0)