Skip to content

armgit / mocha

Public Imported from GitHub
0

☕️ Classic, reliable, trusted test framework for Node.js and the browser

Release 1.4.1

TJ Holowaychukcf1791b705dd
diff --git a/History.md b/History.md
index cbc072ad..04a22727 100644
--- a/History.md
+++ b/History.md
@@ -1,4 +1,11 @@
+1.4.1 / 2012-08-28
+==================
+
+ * add missing `Markdown` export
+ * fix `Mocha#grep()`, escape regexp strings
+ * fix reference error when `devicePixelRatio` is not defined. Closes #549
+
1.4.0 / 2012-08-22
==================
diff --git a/mocha.js b/mocha.js
index c248bff9..e98a0c6b 100644
--- a/mocha.js
+++ b/mocha.js
@@ -940,7 +940,8 @@ require.register("mocha.js", function(module, exports, require){
* Module dependencies.
*/
-var path = require('browser/path');
+var path = require('browser/path')
+ , utils = require('./utils');
/**
* Expose `Mocha`.
@@ -952,7 +953,7 @@ exports = module.exports = Mocha;
* Expose internals.
*/
-exports.utils = require('./utils');
+exports.utils = utils;
exports.interfaces = require('./interfaces');
exports.reporters = require('./reporters');
exports.Runnable = require('./runnable');
@@ -1086,16 +1087,16 @@ Mocha.prototype._growl = function(runner, reporter) {
};
/**
- * Add regexp to grep for to the options object
+ * Add regexp to grep, if `re` is a string it is escaped.
*
- * @param {RegExp} or {String} re
+ * @param {RegExp|String} re
* @return {Mocha}
* @api public
*/
Mocha.prototype.grep = function(re){
this.options.grep = 'string' == typeof re
- ? new RegExp(re)
+ ? new RegExp(utils.escapeRegexp(re))
: re;
return this;
};
@@ -1956,6 +1957,7 @@ exports.Min = require('./min');
exports.Spec = require('./spec');
exports.Nyan = require('./nyan');
exports.XUnit = require('./xunit');
+exports.Markdown = require('./markdown');
exports.Progress = require('./progress');
exports.Landing = require('./landing');
exports.JSONCov = require('./json-cov');
diff --git a/package.json b/package.json
index 7b45ac4c..23146944 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "mocha"
- , "version": "1.4.0"
+ , "version": "1.4.1"
, "description": "simple, flexible, fun test framework"
, "keywords": ["test", "bdd", "tdd", "tap"]
, "author": "TJ Holowaychuk <[email protected]>"