DEV Community

Discussion on: NodeJS - Unit Tests - testing without hitting database. Confusings.

Collapse
 
dmfay profile image
Dian Fay

With every JS test runner I've used, the way you can tell which is which is that some fail when your external dependencies aren't available.

Thread Thread
 
bgadrian profile image
Adrian B.G.

Ah sorry, my bad, now I think I understand what you said, you meant how that framework calls them.

Basically yes, they are all automatic tests.

I replied for an abstract/conceptual level, how you write them, what they are for and when they are run (and how long they should take).

And to answer to the the post question, unit tests are not supposed ti hit any dependency, outside of that function, so it is ok. But you may want to check the other 2 types of tests