sinonjs/sinon

Document how to do simple dependency injection

开放

#1,458 创建于 2017年6月15日

 (5 条评论) (2 个反应) (0 位负责人)JavaScript (764 个派生)batch import
DocumentationHelp wantedgood first issuehacktoberfestpinned

仓库指标

星标
 (9,548 个星标)
PR 合并指标
 (PR 指标待抓取)

描述

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.

贡献者指南