diff --git a/test/fixtures/throws_error1.js b/test/fixtures/throws_error1.js new file mode 100644 index 00000000000..728ece555f5 --- /dev/null +++ b/test/fixtures/throws_error1.js @@ -0,0 +1 @@ +throw new Error("blah"); diff --git a/test/simple/test-module-loading.js b/test/simple/test-module-loading.js index 56515b8850c..460c7942677 100644 --- a/test/simple/test-module-loading.js +++ b/test/simple/test-module-loading.js @@ -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"); });