Skip to content

A QUnit plugin to assert regexp tests. The advantage of using it is the fail output showing the string and the regexp values.

License

Notifications You must be signed in to change notification settings

leobalter/qunit-regexp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

qunit-regexp

Build Status

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

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" );
});

About

A QUnit plugin to assert regexp tests. The advantage of using it is the fail output showing the string and the regexp values.

Resources

License

Stars

Watchers

Forks

Packages

No packages published