chai-match

1.1.1 • Public • Published

Chai Match

Advanced RegExp assertions for Chai.js.

Installation

npm i --save-dev chai-match
var chai = require('chai');
chai.use(require('chai-match'));

API

.capture(n)

Sets the assertion object to a previous match's capture.

expect('some thing to test').to.match(/some (\w+) to test/).and.capture(0).equals('thing');
'Here in London'.should.match(/(here|there) in (\w+)/i).and.capture(1).equals('London');

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.1.1
    15,111
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.1.1
    15,111
  • 1.1.0
    0
  • 1.0.1
    1
  • 1.0.0
    0

Package Sidebar

Install

npm i chai-match

Weekly Downloads

13,565

Version

1.1.1

License

MIT

Last publish

Collaborators

  • johngeorgewright