Posts tagged with "testing"

  • Mocking Classes with TypeScript

    In unit testing, we often want to create mocks of other parts of our app in order to better isolate the particular component under test, and prevent us from dragging the whole dependency graph into our simple little unit test. Dependency graph of a component we want to test In the example above, we could mock out ListComponent, InboxComponent and MessageService and thereby forego the need to pull in all of the transitive dependencies (dependencies of dependencies).