Better require.async throw test

This commit is contained in:
Herbert Vojcik 2010-04-08 16:15:56 +02:00 committed by Ryan Dahl
parent de9778b5bd
commit c16508c87a
2 changed files with 11 additions and 0 deletions

1
test/fixtures/throws_error1.js vendored Normal file
View File

@ -0,0 +1 @@
throw new Error("blah");

View File

@ -56,6 +56,14 @@ try {
assert.equal("blah", e.message);
}
var errorThrownAsync = false;
require.async("../fixtures/throws_error1", function(err, a) {
if (err) {
errorThrownAsync = true;
assert.equal("blah", err.message);
}
});
assert.equal(require('path').dirname(__filename), __dirname);
var asyncRun = false;
@ -103,5 +111,7 @@ process.addListener("exit", function () {
assert.equal(true, asyncRun);
assert.equal(true, errorThrownAsync);
puts("exit");
});