Skip to content

Commit

Permalink
fix: restore backward compatibility for [email protected]
Browse files Browse the repository at this point in the history
This adds `start` method back to the object exported by `lib/server.js`.

Closes 1500
  • Loading branch information
segrey committed Jul 18, 2015
1 parent c483d18 commit 648b357
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ var launcher = require('./launcher')

// TODO: remove in 1.0
var oldServer = {
start: function () {
throw new Error(
'The api interface has changed. Please use \n' +
start: function (cliOptions, done) {
console.error('WARN `start` method is deprecated since 0.13. It will be removed in 0.14. Please use \n' +
' server = new Server(config, [done])\n' +
' server.start()\n' +
'instead.'
)
'instead.')
var server = new Server(cliOptions, done)
server.start()
}
}

Expand Down
9 changes: 9 additions & 0 deletions lib/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,15 @@ Server.prototype.start = function () {
this._injector.invoke(this._start, this)
}

/**
* Backward-compatibility with karma-intellij bundled with WebStorm.
* Deprecated since version 0.13, to be removed in 0.14
*/
Server.start = function (cliOptions, done) {
var server = new Server(cliOptions, done)
server.start()
}

// Get properties from the injector
//
// token - String
Expand Down

0 comments on commit 648b357

Please sign in to comment.