Skip to content

Commit

Permalink
docs: add code examples to all mock functions
Browse files Browse the repository at this point in the history
Closes #221
  • Loading branch information
m-radzikowski committed Jun 1, 2024
1 parent 178e72c commit 776836a
Show file tree
Hide file tree
Showing 2 changed files with 276 additions and 96 deletions.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,18 @@ snsMock
.rejects('mocked rejection');
```

```typescript
const throttlingError = new Error('mocked rejection');
throttlingError.name = 'ThrottlingException';

snsMock
.rejects(throttlingError);
```

In `rejects()`, you can pass a string, an `Error` instance,
or an object with properties.
In each case, it will be converted to an `Error` instance.

Specify custom mock function:

```typescript
Expand Down
Loading

0 comments on commit 776836a

Please sign in to comment.