You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Return the EventEmitter instance so that it's possible to into various lifecycle events. Add a browsers_ready event so that it's possible to know when the karma server has finished starting up.
I am very interested in resolving #1037 (it's breaking our grunt and gulp builds), so if this is not quite the way you want it to be done, let me know and I'll do it differently! :)
Return the EventEmitter instance so that it's possible to hook
into various lifecycle events. Add a "browsers_ready" event so
that it's possible to know when the karma server has finished
starting up.
Enables and partially resolveskarma-runner#1037
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project, in which case you'll need to sign a Contributor License Agreement (CLA).
So in general I like the approach, though I would prefer not returning the globalEmitter from the start function. In my mind the code (not only yours) needs to be refactored in a way that the interacting api would look like
It seems quite a major undertaking to refactor everything but I agree it's the best idea longterm. I could take a stab if it's not in the near future for any of the regular maintainers.
One option to have this quickly and then still support easy migration/backwards compatibility later is to return a subset of the emitter, sort of an interface object. So something like this:
{on: globalEmitter.on.bind(globalEmitter), ...}
Then, in the future, it could just start returning karma itself. I think there's a general need to expand the public API a little bit to enable more diverse workflows.
This adds a slew of new api possibilities to the server. All main
events
from the `globalEmitter` are now emitted on the `server` instances and
publicly available.
For a list of available events see the docs file.
BREAKING CHANGE:
The public api interface has changed to a constructor form. To upgrade
change
```javascript
var server = require(‘karma’).server
server.start(config, done)
```
to
```javascript
var Server = require(‘karma’).Server
var server = new Server(config, done)
server.start()
```
Closeskarma-runner#1037, karma-runner#1482, karma-runner#1467
Oh, that's actually impressively quick! It seems like it will do the trick quite well. I think we're good to close this PR and the issue I mentioned if #1485 goes through. I'll play around with your branch tomorrow.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Return the EventEmitter instance so that it's possible to into various lifecycle events. Add a
browsers_ready
event so that it's possible to know when the karma server has finished starting up.Enables and partially resolves #1037
I am very interested in resolving #1037 (it's breaking our grunt and gulp builds), so if this is not quite the way you want it to be done, let me know and I'll do it differently! :)