Skip to content

Commit

Permalink
Docs: Modified match API documentation (#89)
Browse files Browse the repository at this point in the history
Modified the match API documentation to make it clear that match works
on the string representation of a variable.

Fixes: #67
  • Loading branch information
blacksun1 authored and cjihrig committed Sep 10, 2016
1 parent 452da72 commit 17aa4bc
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion API.md
Original file line number Diff line number Diff line change
Expand Up @@ -565,14 +565,17 @@ expect(new Date()).to.be.an.instanceof(Date);

Aliases: `matches()`

Asserts that the reference value is a string matching the provided regular expression where:
Asserts that the reference value's `toString()` representation matches the provided regular
expression where:
- `regex` - the regular expression to match.

```js
const Code = require('code');
const expect = Code.expect;

expect('a5').to.match(/\w\d/);
expect(["abc", "def"]).to.match(/^[\w\d,]*$/);
expect(1).to.match(/^\d$/);
```

#### `satisfy(validator)`
Expand Down

0 comments on commit 17aa4bc

Please sign in to comment.