Skip to content

Commit

Permalink
docs: Fix a few typos
Browse files Browse the repository at this point in the history
There are small typos in:
- docs/_howto/stub-dependency.md
- docs/index.md

Fixes:
- Should read `laborious` rather than `laborous`.
- Should read `environment` rather than `enviroment`.

Signed-off-by: Tim Gates <tim.gates@iress.com>
  • Loading branch information
timgates42 authored and mroderick committed Nov 28, 2022
1 parent 225b140 commit 49ef930
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/_howto/stub-dependency.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ layout: page
title: How to stub a dependency of a module
---

Sinon is a stubbing library, not a module interception library. Stubbing dependencies is highly dependant on your enviroment and the implementation. For Node environments, we usually recommend solutions targeting [link seams](../link-seams-commonjs/) or explicit dependency injection. Though in some more basic cases, you can get away with only using Sinon by modifying the module exports of the dependency.
Sinon is a stubbing library, not a module interception library. Stubbing dependencies is highly dependant on your environment and the implementation. For Node environments, we usually recommend solutions targeting [link seams](../link-seams-commonjs/) or explicit dependency injection. Though in some more basic cases, you can get away with only using Sinon by modifying the module exports of the dependency.

To stub a dependency (imported module) of a module under test you have to import it explicitly in your test and stub the desired method. For the stubbing to work, the stubbed method cannot be [destructured](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment), neither in the module under test nor in the test.

Expand Down
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ Learn more about [fake XMLHttpRequest][fakexhr].

### Fake server

The preceding example shows how flexible this API is. If it looks too laborous, you may like the fake server:
The preceding example shows how flexible this API is. If it looks too laborious, you may like the fake server:

```javascript
var server;
Expand Down

0 comments on commit 49ef930

Please sign in to comment.