Better require.async throw test
This commit is contained in:
parent
de9778b5bd
commit
c16508c87a
1
test/fixtures/throws_error1.js
vendored
Normal file
1
test/fixtures/throws_error1.js
vendored
Normal file
@ -0,0 +1 @@
|
||||
throw new Error("blah");
|
@ -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");
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user