Skip to content

Commit

Permalink
fixed a child interference problem.
Browse files Browse the repository at this point in the history
  • Loading branch information
dominictarr committed Jan 20, 2011
1 parent d3b854c commit f4637a4
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/child.js
@@ -1,3 +1,10 @@

//this module SHOULD NOT be required as a library, it will interfere.
//must be used in a spawned process.
if (module !== require.main) {
return
}

var testing = require('./testing');

var opts =
Expand All @@ -22,6 +29,7 @@ var s = require(process.ARGV[2]);

testing.runSuite(s, opts);


function postMessage() {
console.log(testing.messageEncode.apply(null, arguments));
}
Expand Down
13 changes: 13 additions & 0 deletions test/test-interference.js
@@ -0,0 +1,13 @@
if (module == require.main) {
return require('async_testing').run(process.ARGV);
}

require('../lib/child')

exports ['test should fail'] = function (test){
test.ok(false)
}

/*
this test will be reported to pass, when clearly it should fail.
*/

0 comments on commit f4637a4

Please sign in to comment.