Almost every module that we use in NodeJS, need to be imported in some way. These modules offer functions that we can use. However, I have noticed that testing frameworks like mocha and jest dont seem to work the same way. You just include "mocha" or "jest" under the "test" script in package.json, and it does all the work.
I am very curious as to how this works. How can we make a script / function execute just by mentioning a keyword under "scripts" in package.json.
Would be very helpful if someone can answer this! :)