Skip to content

Commit

Permalink
Update mocking.md
Browse files Browse the repository at this point in the history
  • Loading branch information
jbelmont committed Feb 7, 2018
1 parent 6ad8d23 commit 000dc78
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions docs/mocking/mocking.md
Expand Up @@ -40,7 +40,7 @@ Test spies are useful to test both callbacks and how certain functions/methods a

**Open program.test.js in `mocks-stubs-spies` folder**

####1. Stub the `retrieveDocument` function
#### 1. Stub the `retrieveDocument` function
```javascript
function retrieveDocument({dbName, name}) {
const couchDBName = nano.use(dbName);
Expand All @@ -59,7 +59,7 @@ You don't need the implementation here but I included it here for your reference
Using Sinon check that the retrieveDocument stub is called once.
Make an assertion that the payload and the expected response match.

####2. Stub the `insertDocument` function.
#### 2. Stub the `insertDocument` function.

```javascript
function insertDocument({ dbName = 'softwaretesting', name = 'users', body } = {}) {
Expand Down Expand Up @@ -93,9 +93,9 @@ function insertDoc({dbName, name, body}) {
* Use sinon to make some assertions about the stubbed out function
* Remember to use the setup function in tape or the before block in mocha to initialize the stub.

####3. Stub out the `deleteDocument` function
#### 3. Stub out the `deleteDocument` function

######Implementation Details
###### Implementation Details
```javascript
function retrieveDoc({dbName, name}) {
return new Promise((resolve, reject) => {
Expand Down

0 comments on commit 000dc78

Please sign in to comment.