Skip to content

Commit

Permalink
Place "Note" directly after function title (#8391)
Browse files Browse the repository at this point in the history
* Place "Note" directly after function title

* Placed "Note" in .toThrow() section after first code block
  • Loading branch information
gugr authored and jeysal committed Apr 29, 2019
1 parent 4c3c712 commit 05b8382
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions docs/ExpectAPI.md
Expand Up @@ -1182,6 +1182,8 @@ test('throws on octopus', () => {
});
```

> Note: You must wrap the code in a function, otherwise the error will not be caught and the assertion will fail.
You can provide an optional argument to test that a specific error is thrown:

- regular expression: error message **matches** the pattern
Expand Down Expand Up @@ -1221,8 +1223,6 @@ test('throws on octopus', () => {
});
```

> Note: You must wrap the code in a function, otherwise the error will not be caught and the assertion will fail.
### `.toThrowErrorMatchingSnapshot(hint?)`

Use `.toThrowErrorMatchingSnapshot` to test that a function throws an error matching the most recent snapshot when it is called.
Expand Down
4 changes: 2 additions & 2 deletions website/versioned_docs/version-22.x/ExpectAPI.md
Expand Up @@ -877,6 +877,8 @@ test('throws on octopus', () => {
});
```

> Note: You must wrap the code in a function, otherwise the error will not be caught and the assertion will fail.
If you want to test that a specific error gets thrown, you can provide an argument to `toThrow`. The argument can be a string that should be contained in the error message, a class for the error, or a regex that should match the error message. For example, let's say that `drinkFlavor` is coded like this:

```js
Expand Down Expand Up @@ -908,8 +910,6 @@ test('throws on octopus', () => {
});
```

> Note: You must wrap the code in a function, otherwise the error will not be caught and the assertion will fail.
### `.toThrowErrorMatchingSnapshot()`

Use `.toThrowErrorMatchingSnapshot` to test that a function throws an error matching the most recent snapshot when it is called. For example, let's say you have a `drinkFlavor` function that throws whenever the flavor is `'octopus'`, and is coded like this:
Expand Down
4 changes: 2 additions & 2 deletions website/versioned_docs/version-23.x/ExpectAPI.md
Expand Up @@ -1173,6 +1173,8 @@ test('throws on octopus', () => {
});
```

> Note: You must wrap the code in a function, otherwise the error will not be caught and the assertion will fail.
If you want to test that a specific error gets thrown, you can provide an argument to `toThrow`. The argument can be a string that should be contained in the error message, a class for the error, or a regex that should match the error message. For example, let's say that `drinkFlavor` is coded like this:

```js
Expand Down Expand Up @@ -1204,8 +1206,6 @@ test('throws on octopus', () => {
});
```

> Note: You must wrap the code in a function, otherwise the error will not be caught and the assertion will fail.
### `.toThrowErrorMatchingSnapshot()`

Use `.toThrowErrorMatchingSnapshot` to test that a function throws an error matching the most recent snapshot when it is called. For example, let's say you have a `drinkFlavor` function that throws whenever the flavor is `'octopus'`, and is coded like this:
Expand Down
4 changes: 2 additions & 2 deletions website/versioned_docs/version-24.0/ExpectAPI.md
Expand Up @@ -1189,6 +1189,8 @@ test('throws on octopus', () => {
});
```

> Note: You must wrap the code in a function, otherwise the error will not be caught and the assertion will fail.
You can provide an optional argument to test that a specific error is thrown:

- regular expression: error message **matches** the pattern
Expand Down Expand Up @@ -1228,8 +1230,6 @@ test('throws on octopus', () => {
});
```

> Note: You must wrap the code in a function, otherwise the error will not be caught and the assertion will fail.
### `.toThrowErrorMatchingSnapshot(hint?)`

Use `.toThrowErrorMatchingSnapshot` to test that a function throws an error matching the most recent snapshot when it is called.
Expand Down

0 comments on commit 05b8382

Please sign in to comment.