Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
Better require.async throw test
Browse files Browse the repository at this point in the history
  • Loading branch information
Herbert Vojcik authored and ry committed Apr 8, 2010
1 parent de9778b commit c16508c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions test/fixtures/throws_error1.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
throw new Error("blah");
10 changes: 10 additions & 0 deletions test/simple/test-module-loading.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -103,5 +111,7 @@ process.addListener("exit", function () {

assert.equal(true, asyncRun);

assert.equal(true, errorThrownAsync);

puts("exit");
});

0 comments on commit c16508c

Please sign in to comment.