Browse Source

Better require.async throw test

v0.7.4-release
Herbert Vojcik 15 years ago
committed by Ryan Dahl
parent
commit
c16508c87a
  1. 1
      test/fixtures/throws_error1.js
  2. 10
      test/simple/test-module-loading.js

1
test/fixtures/throws_error1.js

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

10
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");
});

Loading…
Cancel
Save