Permalink
Browse files

process.nextTick + mocha hack to support it

  • Loading branch information...
1 parent 15af50d commit cabb2f5b1809f7825418b277bc63e34a5f4991bc @lightsofapollo committed Aug 29, 2012
Showing with 13 additions and 2 deletions.
  1. +3 −0 HISTORY.md
  2. +5 −0 lib/modules/mocha-bin.js
  3. +4 −0 lib/modules/process.js
  4. +1 −1 package.json
  5. +0 −1 test/xhr-test.js
View
@@ -1,3 +1,6 @@
+# 0.4.4
+ - process.nextTick to keep mocha test-stacks under control.
+
# 0.4.2
- Silent installer
View
@@ -3,6 +3,8 @@ var env = require('env');
process = window.process = require('process');
+var nextTick = process.nextTick;
+
function MochaBin(mocha, commander) {
var prefix = __dirname + '/../../vendor/';
@@ -16,6 +18,9 @@ function MochaBin(mocha, commander) {
commander = require(prefix + 'commander.js');
}
+ // restore process next tick...
+ process.nextTick = nextTick;
+
this.mocha = mocha;
this.commander = commander;
}
View
@@ -2,6 +2,10 @@ module.exports = {
/* XXX: this is a hack! */
umask: function() { return 18; },
+ nextTick: function(cb) {
+ setTimeout(cb, 0);
+ },
+
argv: window.xpcArgv,
cwd: function() {
return _IMPORT_ROOT;
View
@@ -1,6 +1,6 @@
{
"name": "xpcwindow",
- "version": "0.4.3",
+ "version": "0.4.4",
"author": "James Lal <jlal@mozilla.com>",
"description": "xpcshell wrapper that provides 'window' shims to run browser code in xpcom. (WARN: Does not use node)",
"main": "lib/node/index.js",
View
@@ -3,7 +3,6 @@ describe('xhr', function() {
it('should be able to load file://', function() {
var path = 'file://' + __dirname + '/fixtures/file.js';
var xhr = new XMLHttpRequest();
-
xhr.open('GET', path, true);
xhr.onreadystatechange = function() {

0 comments on commit cabb2f5

Please sign in to comment.