Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/leobalter/qunit-regexp
A QUnit plugin to assert regexp tests. The advantage of using it is the fail output showing the string and the regexp values.
https://github.com/leobalter/qunit-regexp
Last synced: about 2 months ago
JSON representation
A QUnit plugin to assert regexp tests. The advantage of using it is the fail output showing the string and the regexp values.
- Host: GitHub
- URL: https://github.com/leobalter/qunit-regexp
- Owner: leobalter
- License: other
- Created: 2015-03-30T20:56:03.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2015-03-30T21:12:53.000Z (almost 10 years ago)
- Last Synced: 2024-11-19T19:06:25.945Z (about 2 months ago)
- Language: JavaScript
- Size: 113 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# qunit-regexp
[![Build Status](https://travis-ci.org/leobalter/qunit-regexp.svg)](https://travis-ci.org/leobalter/qunit-regexp)
A QUnit plugin to assert regexp tests. The advantage of using it is the fail output showing the string and the regexp values.
## Install
This module requires the original QUnit (on npm as `qunitjs`) in order to run.
```
npm install --save-dev qunitjs qunit-regexp
```## Usage
```js
QUnit.test( "RegExps", function( assert ) {
assert.regexp( "Cheers!", "^Cheers!$", "accepts a string" );
assert.regexp( "Cheers!", /^cheers!$/i, "accepts a regexp with flags" );
assert.regexp( "Cheers!", /^Cheers!$/, "accepts a regexp" );
});
```