Skip to content

re: NodeJS - Unit Tests - testing without hitting database. Confusings. VIEW POST

re: I'm pretty sure there is a big distinction between unit tests and integration tests, in any language, framework or paradigm.

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.

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

code of conduct - report abuse