Skip to content

Latest commit

 

History

History
15 lines (8 loc) · 294 Bytes

match.md

File metadata and controls

15 lines (8 loc) · 294 Bytes

match

  • to[.not].match

The match assertion checks that the actual value match an expected RegExp.

For example:

expect('WORLD').to.match(/world/i);

Further:

expect(2).to.match(/\d+/);

The above works because the actual value (2 above) is first converted to a string.