Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make stryker config file mandatory #390

Closed
nicojs opened this issue Sep 22, 2017 · 5 comments · Fixed by #404
Closed

Make stryker config file mandatory #390

nicojs opened this issue Sep 22, 2017 · 5 comments · Fixed by #404
Labels
🚀 Feature request New feature request 👶 Good first issue Good for newcomers

Comments

@nicojs
Copy link
Member

nicojs commented Sep 22, 2017

Running stryker with command line options won't read a stryker.conf.js file. This results in unexpacted behavior, for example:

$ stryker run
[2017-09-22 15:30:17.180] [INFO] ConfigReader - Using stryker.conf.js in the current working directory.
...
[2017-09-22 15:30:29.083] [INFO] Stryker - Done in 11 seconds.

$ stryker run --logLevel debug
[2017-09-22 15:30:35.483] [INFO] ConfigReader - No config file specified. Running with command line arguments

I think it would be more useful to always require a stryker.conf.js file to be specified.

@nicojs nicojs added 👶 Good first issue Good for newcomers 🚀 Feature request New feature request labels Sep 22, 2017
@Be-ngt-oH
Copy link
Contributor

Hi there :-),

got here by the hacktoberfest label and I'd like to fix this. However, I suggest a slightly different behavior.

Either we have a config file specified or not. If we have one - great, use it! If we don't - let's try stryker.conf.js. In both cases, command line arguments should override settings from the config file.
If there is no config specified and no stryker.conf.js in the dir, then it will just be the command line arguments.

What do you think?

@nicojs
Copy link
Member Author

nicojs commented Oct 2, 2017

Hi @Be-ngt-oH 😄

Great idea, let's do that.

@simondel
Copy link
Member

simondel commented Oct 2, 2017

Hi @Be-ngt-oH

Glad to hear that the tag is working! If you need any more info, feel free to ask for it :)

Happy hacking!

Be-ngt-oH added a commit to Be-ngt-oH/stryker that referenced this issue Oct 2, 2017
Change ConfigReader behavior to always use stryker.conf.js if present. CLI
options override options from the file.

Run does not fail anymore if a CLI option, but no config file is specified.
closes stryker-mutator#390
nicojs pushed a commit that referenced this issue Oct 3, 2017
Use the stryker.conf.js file in the current working directory, if one is present. Display 'Use `stryker init` command to generate your config file.' when stryker is run without a config file.

Closes #390
@j-truax
Copy link

j-truax commented Oct 3, 2017

To make sure I understand correctly, is this request removing the ability to directly define a grunt task in Gruntfile.js that has all the config settings in it?

example...

stryker: {
	mutate: {
		options: {
        		files: [
            			{ pattern: 'src/**/*.js', mutated: true},
            			'test/**/*.spec.js'
        		],
        		testRunner: 'karma',
        		testFramework: 'jasmine',
        		coverageAnalysis: 'all',
        		reporter: ['clear-text', 'html', 'event-recorder'],
        		thresholds: {
            			high: 90,
            			low: 50,
            			break: 95
        		}
		}
	}
}

@nicojs
Copy link
Member Author

nicojs commented Oct 3, 2017

Well, it might have if @Be-ngt-oH didn't step in and did his suggestion. So your example should still work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🚀 Feature request New feature request 👶 Good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants