Skip to content

Commit

Permalink
Update docs to use results instead of returnValues for mock functions (
Browse files Browse the repository at this point in the history
…#6376)

* Update docs to use results instead of returnValues for mock functions

* Update to use value and update main MockFunctions.md file

* Update for value
  • Loading branch information
WillBrock authored and rickhanlonii committed Jun 1, 2018
1 parent d7578d3 commit ddfa099
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions docs/MockFunctions.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ expect(mockCallback.mock.calls[0][0]).toBe(0);
expect(mockCallback.mock.calls[1][0]).toBe(1);

// The return value of the first call to the function was 42
expect(mockCallback.mock.returnValues[0]).toBe(42);
expect(mockCallback.mock.results[0].value).toBe(42);
```

## `.mock` property
Expand Down Expand Up @@ -67,7 +67,7 @@ expect(someMockFunction.mock.calls[0][0]).toBe('first arg');
expect(someMockFunction.mock.calls[0][1]).toBe('second arg');

// The return value of the first call to the function was 'return value'
expect(someMockFunction.mock.returnValues[0]).toBe('return value');
expect(someMockFunction.mock.results[0].value).toBe('return value');

// This function was instantiated exactly twice
expect(someMockFunction.mock.instances.length).toBe(2);
Expand Down
4 changes: 2 additions & 2 deletions website/versioned_docs/version-23.0/MockFunctions.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ expect(mockCallback.mock.calls[0][0]).toBe(0);
expect(mockCallback.mock.calls[1][0]).toBe(1);

// The return value of the first call to the function was 42
expect(mockCallback.mock.returnValues[0]).toBe(42);
expect(mockCallback.mock.results[0].value).toBe(42);
```

## `.mock` property
Expand Down Expand Up @@ -68,7 +68,7 @@ expect(someMockFunction.mock.calls[0][0]).toBe('first arg');
expect(someMockFunction.mock.calls[0][1]).toBe('second arg');

// The return value of the first call to the function was 'return value'
expect(someMockFunction.mock.returnValues[0]).toBe('return value');
expect(someMockFunction.mock.results[0].value).toBe('return value');

// This function was instantiated exactly twice
expect(someMockFunction.mock.instances.length).toBe(2);
Expand Down

0 comments on commit ddfa099

Please sign in to comment.