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

Clarity on projectType=react #1435

Closed
coleturner opened this issue Mar 1, 2019 · 10 comments
Closed

Clarity on projectType=react #1435

coleturner opened this issue Mar 1, 2019 · 10 comments
Labels
hacktoberfest https://hacktoberfest.digitalocean.com/

Comments

@coleturner
Copy link

Summary

Hi! I'm getting started with this project and I wanted to share some confusion I had around projectType=react.

I think it's worth clarifying that react here is create-react-app and not general purpose React. During the installation I selected this thinking it came with specific Babel transforms or mutants. Then I ran into an error about missing react-scripts/ which I was able to recognize. There's not much in the way of issues for this particular error however and that lead me to create this issue.

Would you consider expanding the terminology (particularly for installation) to clarify that it's create-react-app specifically?

@simondel
Copy link
Member

simondel commented Mar 2, 2019

Thanks for opening this issue!

Do you mean the setting in the Jest runner as described in its README:
https://www.npmjs.com/package/@stryker-mutator/jest-runner#configuring-jest

Or do you mean the 'react' option in the preset configurations? (which also sets the jest-runner to 'react'):
image

@coleturner
Copy link
Author

Hey @simondel thanks for replying! That is the correct menu I selected though I think it might be worth keeping them both aligned. I know CRA is ubiquitous but I worry for those who have never used it and wouldn't recognize the error :)

@simondel
Copy link
Member

simondel commented Mar 2, 2019

Well, the preset is actually for create-react-app projects so I think it's ok to rename that to create-react-app.

@nicojs
Copy link
Member

nicojs commented Mar 4, 2019

We could also simply improve the documentation in both places. Instead of another deprecation 😰

@coleturner
Copy link
Author

Good point @nicojs I was worried about the major semver change, I think even parenthesis with (create-react-app) would suffice. For the JS configuration files it's a little different but I think a JS comment would suffice too.

@skyboyer
Copy link

it works for my non-CRA application but I had to put

      projectType: 'custom',

and remove config entry from stryker.conf.js to make it run without errors

@simondel simondel added the hacktoberfest https://hacktoberfest.digitalocean.com/ label Sep 25, 2019
@MrFix93
Copy link
Contributor

MrFix93 commented Jan 20, 2020

I can confirm that the fix from @skyboyer works for non-'create-react-app' react projects. I think the suggestion from @simondel to rename the option to create-react-app in the cli, should be sufficient to inform people this only works for these kinds op react projects.

@nicojs
Copy link
Member

nicojs commented Jan 20, 2020

Ok, sounds good. We're welcoming PR's. Please implement it without breaking changes (log a deprecation warning accordingly).

MrFix93 pushed a commit to MrFix93/stryker that referenced this issue Jan 21, 2020
As reported (stryker-mutator#1435) the react preset is only applicable to a react project set up by create-react-app.
In addition, the error (unable to locate package react-scripts) isn't that useful either.
Therefore, I propose we change the projectType to react-create-app as it resembles the applicability of this preset.
@bartekleon
Copy link
Member

Is it still a valid issue? There were quite a lot of changes and also some deprecations and removals (especially in stryker 4)

@coleturner
Copy link
Author

LGTM! Thanks @MrFix93

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hacktoberfest https://hacktoberfest.digitalocean.com/
Projects
None yet
Development

No branches or pull requests

6 participants