chai-nodules-helpers
Advanced tools
Comparing version 2.0.0 to 2.0.1
@@ -13,11 +13,5 @@ module.exports = function(chai) { | ||
try { | ||
switch (typeof spec) { | ||
case 'string': | ||
// get code by code name | ||
spec = ErrClass.CODES[spec]; | ||
/* falls through */ | ||
case 'number': | ||
// get message template by code and convert it to appropriate regexp | ||
spec = new RegExp('^' + ErrClass.MESSAGES[spec].replace(/%.*%/g, '.*') + '$', 'ig'); | ||
// in other cases keep the spec as is | ||
if (typeof spec === 'string') { | ||
// get message template by code and convert it to appropriate regexp | ||
spec = new RegExp('^' + ErrClass.MESSAGES[spec].replace(/%.*%/g, '.*') + '$', 'ig'); | ||
} | ||
@@ -24,0 +18,0 @@ } catch (error) { |
{ | ||
"name": "chai-nodules-helpers", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"description": "nodules-specific assertion helpers for chai", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
25098
299