sinonjs/sinon

Document how to do simple dependency injection

Open

#1,458 opened on Jun 15, 2017

View on GitHub
 (5 comments) (2 reactions) (0 assignees)JavaScript (764 forks)batch import
DocumentationHelp wantedgood first issuehacktoberfestpinned

Repository metrics

Stars
 (9,548 stars)
PR merge metrics
 (Avg merge 6d 16h) (15 merged PRs in 30d)

Description

There are usually three main categories of stubbing when dealing with network requests:

  1. stubbing out the api doing the actual network calls using a link seam
  2. stubbing out the api doing the actual network calls using dependency injection of some sort
  3. stubbing out the network layer in the underlying engine (browser or Node)

Presently we only have one article covering the first option, and very little on the two next approaches. We should create a small how-to for the article section that covers how to do basic (no framework) dependency injection.

I have already written a lot of text that could serve as the basis for such an article.

Contributor guide