Skip to content

Commit

Permalink
linked to cheatsheet EVERYWHERE
Browse files Browse the repository at this point in the history
  • Loading branch information
wheresrhys committed Mar 22, 2020
1 parent 1d2557d commit d22e983
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 2 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ Features include:

_New_ If using jest, try the new [fetch-mock-jest](https://www.npmjs.com/package/fetch-mock-jest) wrapper.

_New_ [Cheatsheet](https://github.com/wheresrhys/fetch-mock/blob/master/docs/cheatsheet.md)

![node version](https://img.shields.io/node/v/fetch-mock.svg?style=flat-square)
[![licence](https://img.shields.io/npm/l/fetch-mock.svg?style=flat-square)](https://github.com/wheresrhys/fetch-mock/blob/master/LICENSE)
![npm downloads](https://img.shields.io/npm/dm/fetch-mock.svg?style=flat-square)
Expand Down Expand Up @@ -52,7 +54,7 @@ fetch-mock requires the following to run:

## Documentation and Usage

See the [project website](http://www.wheresrhys.co.uk/fetch-mock/)
See the [project website](http://www.wheresrhys.co.uk/fetch-mock/) or [cheatsheet](https://github.com/wheresrhys/fetch-mock/blob/master/docs/cheatsheet.md)

If you're using jest as your test runner, consider using [fetch-mock-jest](https://www.npmjs.com/package/fetch-mock-jest), a lightweight, jest-friendly wrapper around fetch-mock.

Expand Down
3 changes: 3 additions & 0 deletions docs/_api-inspection/fundamentals.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
title: "Inspection fundamentals"
position: 0
description: |-
Check out the new [cheatsheet](https://github.com/wheresrhys/fetch-mock/blob/master/docs/cheatsheet.md)
{: .info}
`fetch-mock`'s inspection methods allow information about how `fetch` was called to be retrieved after your application code has run. Most inspection methods take two arguments — `filter` and `options` — which allow individual, or groups of, `fetch` calls to be extracted and examined.
parameters:
- name: filter
Expand Down
3 changes: 3 additions & 0 deletions docs/_api-mocking/mock.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ title: ".mock(matcher, response, options)"
navTitle: .mock()
position: 1
description: |
Check out the new [cheatsheet](https://github.com/wheresrhys/fetch-mock/blob/master/docs/cheatsheet.md)
{: .info}
Initialises or extends a stub implementation of fetch, applying a `route` that matches `matcher`, delivers a `Response` configured using `response`, and that respects the additional `options`. The stub will record its calls so they can be inspected later. If `.mock` is called on the top level `fetch-mock` instance, this stub function will also replace `fetch` globally. Calling `.mock()` with no arguments will carry out this stubbing without defining any mock responses.
In the documentation, **route** is often used to refer to the combination of matching and responding behaviour set up using a single call to `mock()`
Expand Down
7 changes: 6 additions & 1 deletion docs/_includes/sidebar.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,12 @@ <h1>{{ collection.title }}</h1>
{% endfor %}
{%if collection.title == "About" %}
<li>
<a class="github-link" href="https://github.com/wheresrhys/fetch-mock"">
<a href="https://github.com/wheresrhys/fetch-mock/blob/master/docs/cheatsheet.md">
Cheatsheet
</a>
</li>
<li>
<a class="github-link" href="https://github.com/wheresrhys/fetch-mock">
Github project
</a>
</li>
Expand Down
3 changes: 3 additions & 0 deletions docs/_usage/requirements.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,7 @@ content_markdown: |-
- Either
- [node-fetch](https://www.npmjs.com/package/node-fetch) when testing in Node.js. To allow users a choice over which version to use, `node-fetch` is not included as a dependency of `fetch-mock`.
- A browser that supports the `fetch` API either natively or via a [polyfill/ponyfill](https://ponyfoo.com/articles/polyfills-or-ponyfills)
Check out the new [cheatsheet](https://github.com/wheresrhys/fetch-mock/blob/master/docs/cheatsheet.md)
{: .info}
---

0 comments on commit d22e983

Please sign in to comment.