Commit f7c8ce56 authored by Robert Knight's avatar Robert Knight

Escape string in regex pattern in timestamp test

Under PhantomJS 2.x, the output of `Date.toLocaleTimeString()` includes
'GMT+01:00', where the '+' needs to be escaped.
parent 7d6d7bf6
'use strict'; 'use strict';
var angular = require('angular'); var angular = require('angular');
var escapeStringRegexp = require('escape-string-regexp');
var util = require('./util'); var util = require('./util');
...@@ -83,7 +84,7 @@ describe('timestamp', function () { ...@@ -83,7 +84,7 @@ describe('timestamp', function () {
// The exact format of the result will depend on the current locale, // The exact format of the result will depend on the current locale,
// but check that at least the current year and time are present // but check that at least the current year and time are present
assert.match(element.ctrl.absoluteTimestamp, new RegExp('.*2016.*' + assert.match(element.ctrl.absoluteTimestamp, new RegExp('.*2016.*' +
expectedDate.toLocaleTimeString())); escapeStringRegexp(expectedDate.toLocaleTimeString())));
}); });
}); });
}); });
...@@ -37,6 +37,7 @@ ...@@ -37,6 +37,7 @@
"dom-seek": "^1.0.1", "dom-seek": "^1.0.1",
"end-of-stream": "^1.1.0", "end-of-stream": "^1.1.0",
"escape-html": "^1.0.3", "escape-html": "^1.0.3",
"escape-string-regexp": "^1.0.5",
"exorcist": "^0.4.0", "exorcist": "^0.4.0",
"extend": "^2.0.0", "extend": "^2.0.0",
"gulp": "^3.9.1", "gulp": "^3.9.1",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment