Skip to content

Commit

Permalink
chore(docs): add assert.match and assert.not.match info (#118)
Browse files Browse the repository at this point in the history
* docs: added information for assert.match

* docs: added information for assert.not.match

* docs: added more information per requested change
  • Loading branch information
aldy505 authored Jun 6, 2021
1 parent a1f9bfb commit 271b7f1
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions docs/api.assert.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,17 @@ assert.instance([1, 2, 3], Array);
assert.instance(/foobar/gi, RegExp);
```

### match(actual: string, expects: RegExp | String, msg?: Message)
Assert that `actual` matches the `expects` pattern.

When `expects` is a regular expression, it must match the `actual` value.
When `expects` is a string, it must exist within the `actual` value as a substring.

```js
assert.match('hello world', 'wor');
assert.match('hello world', /^hel/);
```

### snapshot(actual: string, expects: string, msg?: Message)
Assert that `actual` matches the `expects` multi-line string.

Expand Down Expand Up @@ -176,6 +187,17 @@ assert.not.instance([1, 2, 3], String);
assert.not.instance(/foobar/gi, Date);
```

### not.match(actual: string, expects: RegExp | String, msg?: Message)
Assert that `actual` does not match the `expects` pattern.

When `expects` is a regular expression, it must not match the `actual` value.
When `expects` is a string, it must not exist within the `actual` value as a substring.

```js
assert.not.match('hello world', 'other');
assert.not.match('hello world', /other/g);
```

### not.snapshot(actual: string, expects: string, msg?: Message)
Assert that `actual` does not match the `expects` snapshot.

Expand Down

0 comments on commit 271b7f1

Please sign in to comment.