question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Make testing a dependency, not built in

See original GitHub issue

You 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:closed
  • Created 7 years ago
  • Reactions:11
  • Comments:23 (15 by maintainers)

github_iconTop GitHub Comments

2reactions
gaearoncommented, Aug 5, 2016

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:

  • Spending effort into splitting packages and automating additional configuration steps.
  • Making already created apps depend on an internet connection for activating some features. (We want to move in the exact opposite direction: #373.)
  • Creating an impression that -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:

  • Somebody has created a community-supported integration package for another test runner and has demonstrated the willingness to maintain it.
  • This person can give us specific feedback on what hooks they would like to see exposed from our side to make such integration easier to support, and is willing to prototype such support as a PR.
  • A significant count of our users tell us they are happier with that configuration than the one we ship by default. (Actually, in this case, we might just switch Jest to something else here rather than allow more choice.)

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.

2reactions
cpojercommented, Aug 4, 2016

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found