+1 vote
in NodeJS Essentials by

What's a test pyramid? Give an example!

1 Answer

0 votes
by

A test pyramid describes the ratio of how many unit tests, integration tests and end-to-end test you should write.

Node.js Unit Testing Test Pyramid

An example for an HTTP API may look like this:

lots of low-level unit tests for models (dependencies are stubbed),

fewer integration tests, where you check how your models interact with each other (dependencies are not stubbed),

less end-to-end tests, where you call your actual endpoints (dependencies are not stubbed).

Related questions

+1 vote
asked May 31, 2020 in NodeJS Essentials by Robindeniel
+1 vote
asked May 31, 2020 in NodeJS Essentials by Robindeniel
...