npm Community Forum (Archive)

The npm community forum has been discontinued.

To discuss usage of npm, visit the GitHub Support Community.

A package which will prevent executing any test runners (eg: Mocha) in none development environment

I would like to write a package which prevents executing test runners (such as Moch) in none development environments. This may be sound weird but I have heard that executing tests in the none development environment cause lots of problems. This may have not happened to in a properly setup environment or in a process. But it’s not uncommon to a new startup or new team to mess it up.
I already posted this idea in Reddit but, it seems to be a useless idea based on their input. But I would like to have an opinion in this group too. Thank you.

Hi Ruwan. Do you mind providing some links to the Reddit post? I’m curious to see what their input was.

My opinion on your idea is that it’s the development team’s responsibility to setup their build scripts and environments properly so that unit tests, e2e tests, and integration tests aren’t run in non-development environments (e.g., production). I don’t think that creating a piece of software to prevent this from happening is doing anyone any favors. There is a lack of understanding in how software should be deployed if a package needs to be installed (which makes your application heavier) to prevent tests from running in non-development environments. This may sound harsh, but I’m trying to be honest, not rude.

Additionally, modules shouldn’t be installed directly on the production servers themselves. The deployables just need to be dropped there. CI tools like Jenkins ensure that this is done efficiently and effectively.

If you have any other questions feel free to ask.

Hi Biran,
Thank you very much for the input. This the Reddit link I mentioned.

I will look into different ideas. Thanks a lot.

No problem. I saw that Reddit said a lot of similar things I said, so maybe we just think your time can be spent on something much more productive. I also agree with someone that stated that “you won’t learn much from creating something like that.”

Good luck on your endeavors.