test: modify async native test.js to test for #4820
authorNathan Rajlich <nathan@tootallnate.net>
Thu, 21 Feb 2013 20:54:13 +0000 (12:54 -0800)
committerNathan Rajlich <nathan@tootallnate.net>
Thu, 21 Feb 2013 21:14:07 +0000 (13:14 -0800)
test/addons/async-hello-world/test.js

index 535d1ab..83f5e72 100644 (file)
@@ -1,7 +1,15 @@
 var assert = require('assert');
 var binding = require('./build/Release/binding');
+var called = false;
+
+process.on('exit', function () {
+  assert(called);
+});
+
 binding(5, function (err, val) {
   assert.equal(null, err);
   assert.equal(10, val);
-  console.error('done :)');
+  process.nextTick(function () {
+    called = true;
+  });
 });