...

/

Introduction to Mocking Packages

Introduction to Mocking Packages

Learn why and how we mock dependencies.

Why do we mock packages?

Open-source software is a vital part of any modern codebase. It allows us to gain robust features and support complex logic with as little as just a few lines of code. These same external libraries often don’t play nice with testing environments out of the box, though.

This won’t be true for all external packages, and each package should be considered individually. Entire frameworks like Koa and Angular are packaged as third-party code, and we don’t want to mock these. ...