james-proxy / james-browser-launcher

Detect, launch and stop browsers
Other
23 stars 15 forks source link

Support Karma browser launcher plugins #20

Closed mitchhentges closed 8 years ago

mitchhentges commented 8 years ago

See how Karma loads plugins and how each launcher has this launcher:xyz syntax.

This will be super-helpful, especially if james-browser-launcher dies, and a new browser comes out. Rather than attempting to get a PR into james-browser-launcher (though that's awesome, too), a plugin can be used.

mitchhentges commented 8 years ago

A couple things to note:

  1. We can't be like karma and just check the node_modules folder for certain packages. browser-launcher will probably be used in a customer environment, and those don't have node_modules folders. Instead, the consumer of browser-launcher should directly require and provide the karma launchers to browser-launcher.
  2. Each karma browser launcher has some $inject information. Ideally, most of injected things should be mockable, but this might turn out to be a bust.
mitchhentges commented 8 years ago

After looking into this further, it's simply too much. Karma is very closely tied to Angular (there's some $inject shenanigans) and the plugins themselves are very close to Karma.

A ton of things would need to be mocked out, or copied from Karma - what about current bugs? Do we keep copying Karma's code into browser-laucher? We can't just have Karma as a dependency, that's really weird.

The baseBrowserLauncher is actually a rabbit hole of prototypes and processLaunchers and KarmaEventEmitters. Oh my.

Anways, if someone wants to submit a PR, feel free, but it'll be a fair amount of work.