Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix missing methods/globals in IE7, IE8 environments #2259

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions lib/context.js
@@ -1,3 +1,9 @@
/**
* Module dependencies.
*/

var JSON = require('json3');

/**
* Expose `Context`.
*/
Expand Down
1 change: 1 addition & 0 deletions lib/runnable.js
Expand Up @@ -3,6 +3,7 @@
*/

var EventEmitter = require('events').EventEmitter;
var JSON = require('json3');
var Pending = require('./pending');
var debug = require('debug')('mocha:runnable');
var milliseconds = require('./ms');
Expand Down
4 changes: 3 additions & 1 deletion lib/utils.js
Expand Up @@ -4,13 +4,15 @@
* Module dependencies.
*/

var JSON = require('json3');
var basename = require('path').basename;
var debug = require('debug')('mocha:watch');
var exists = require('fs').existsSync || require('path').existsSync;
var glob = require('glob');
var join = require('path').join;
var readdirSync = require('fs').readdirSync;
var statSync = require('fs').statSync;
var toISOString = require('@segment/to-iso-string');
var watchFile = require('fs').watchFile;

/**
Expand Down Expand Up @@ -481,7 +483,7 @@ function jsonStringify(object, spaces, depth) {
case 'date':
var sDate = isNaN(val.getTime()) // Invalid date
? val.toString()
: val.toISOString();
: toISOString(val);
val = '[Date: ' + sDate + ']';
break;
case 'buffer':
Expand Down
2 changes: 2 additions & 0 deletions package.json
Expand Up @@ -269,13 +269,15 @@
"test": "make test-all"
},
"dependencies": {
"@segment/to-iso-string": "0.0.2",
"commander": "2.3.0",
"debug": "2.2.0",
"diff": "1.4.0",
"escape-string-regexp": "1.0.2",
"glob": "3.2.11",
"growl": "1.9.2",
"jade": "0.26.3",
"json3": "^3.3.2",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Carret makes npm cry.

"mkdirp": "0.5.1",
"supports-color": "1.2.0"
},
Expand Down