Permalink
Browse files

fixed a child interference problem.

  • Loading branch information...
dominictarr committed Jan 20, 2011
1 parent d3b854c commit f4637a484be23b0dfefc4fcbe6ac4caa72fc1778
Showing with 21 additions and 0 deletions.
  1. +8 −0 lib/child.js
  2. +13 −0 test/test-interference.js
View
@@ -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 =
@@ -22,6 +29,7 @@ var s = require(process.ARGV[2]);
testing.runSuite(s, opts);
+
function postMessage() {
console.log(testing.messageEncode.apply(null, arguments));
}
View
@@ -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.