Skip to content
This repository has been archived by the owner on Dec 17, 2018. It is now read-only.

Watching tests shouldn't restrict browser choices #96

Open
SirDarquan opened this issue Feb 4, 2018 · 2 comments
Open

Watching tests shouldn't restrict browser choices #96

SirDarquan opened this issue Feb 4, 2018 · 2 comments

Comments

@SirDarquan
Copy link

Currently, running tests has three options: Headless, Watch and All. I can do a headless test, which seems to be meant for CI environments. I can watch tests and the Chrome browser will open and continuously retest as I develop. All will test in both Chrome and Headless for a single run. There also the default, but that is just the Headless configuration. While convenient, his actually causes a few problems. First it assumes the developer has Chrome installed. I know it's preposterous to think someone doesn't have Chrome installed but at my normal job, there was a developer who was so Open Source oriented that he used Chromium instead of Chrome. We had to adjust our debugging process for him. Headless is a nice option since it can be installed with npm with no work from the developer. The all option uses the values in the karma config file and should be the default. Watching on the other hand should be option at all times. As such, you should move watching to a literal option which would produce:
ngl test <= would test against all browsers the karma config
ngl test headless <= would test against PhantomJs
ngl test --watch <= would test against all browsers in the karma config continuously
ngl test headless --watch <= would test against PhantomJs continuously
ngl test --browsers=Chrome,Firefox <= overrides the browsers to test with
ngl test --browsers=Chrome,Firefox --watch <= overrides the browsers to test with continuously

IMO, this gives us the best options for both a CI perspective and local testing.

@gonzofish
Copy link
Owner

My first question here, you couldn't override the broswer by using a karma.conf.js via custom configuration?

If that's the case, we could just fix that mechanism to ensure that the custom config supersedes the base browsers specified in the test.js file

@SirDarquan
Copy link
Author

Currently the custom config is merged with the base config and there's nothing wrong with that. The override is only for situations where you want to test a subset of browsers without changing your config. I made a PR to show what I mean.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants