Make testing a dependency, not built in
See original GitHub issueYou can’t introduce testing w/o introducing religion, unfortunately. For example, I refuse to test my UI in an environment where I can’t actually render it in a browser and step through problems in real browsers to fix bugs. Asking folks to eject
because they don’t like your religion seems a little harsh.
Seems like for testing we ought to be able to have a module on npm called react-scripts-jest
, require it in the app’s package.json, and then have npm test
be something like:
{
"scripts": {
"test": "react-scripts-jest"
}
}
That would be the default or create-react-app
, but other folks can create react-scripts-karma
or just roll their own inside the project.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:11
- Comments:23 (15 by maintainers)
Top Results From Across the Web
Maven: how to add a dependency as provided for runtime, but ...
A provided dependency is available on the test classpath, so setting the scope to provided should be fine. See also the definition of ......
Read more >Favor real dependencies for unit testing - Stack Overflow Blog
And I am arguing that this is an anti-pattern. The class-based tests serve as a checksum on existing behavior, do not model actual...
Read more >(Why) is it important that a unit test not test dependencies?
One of the most important aspect of unit testing is to make your tests trustworthy. If you don't trust that a passing test...
Read more >Set up project for AndroidX Test - Android Developers
To modify your app project's dependencies, complete the following steps: Step 1: Open the build.gradle file for your Gradle module. Step 2: In ......
Read more >Test dependencies are not registered in gradle #808 - GitHub
I have a 3-project Gradle build with 3 projects, each with their own main and test: ... Test dependencies are not registered in...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I understand that increasing the download size is frustrating. However I’m not sure the difference between ~10 MB and ~15 MB download is significant enough to warrant:
-jest
is just one of the options when there is nobody who volunteered to create and support other options.I am closing this because I don’t see how this is immediately actionable, and who is willing to lead such effort. I am happy to revisit this if:
In the meantime, we will be improving Jest in response to our users’s feedback. If this doesn’t answer your concerns, perhaps these alternatives could work better for your use case.
I think what a lot of people are missing is that we don’t have a single line of config inside of the created app that is related to testing, except of course for the scripts entry to run react-script’s test command. Anyone can just simply install whatever they like and update the test command with no additional overhead. I think this is reasonable.