sinonjs / sinonjs/sinon

Document how to do simple dependency injection

Open
#1,458 5 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Documentation good first issue hacktoberfest Help wanted pinned
Dominant language
JavaScript
Stars
9.8k
Forks
809
PR merge metrics
No 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in the article section and review the existing article covering link-seam stubbing, then use the linked Stack Overflow answer and Sinon issue comment as source material. The work is done when a small how-to explains basic, framework-free dependency injection for stubbing network-request dependencies.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.