Browse Source

Simple test case for require.async()

This is to make sure this doesn't break after implementing the new
truly sync require() function.
v0.7.4-release
Felix Geisendörfer 15 years ago
committed by Ryan Dahl
parent
commit
211e82e8d9
  1. 8
      test/mjsunit/test-module-loading.js

8
test/mjsunit/test-module-loading.js

@ -57,6 +57,14 @@ try {
assert.equal(require('path').dirname(__filename), __dirname); assert.equal(require('path').dirname(__filename), __dirname);
require.async('./fixtures/a')
.addCallback(function(a) {
assert.equal("A", a.A());
})
.addErrback(function() {
assert.ok(false, 'async loading broken?');
});
process.addListener("exit", function () { process.addListener("exit", function () {
assert.equal(true, a.A instanceof Function); assert.equal(true, a.A instanceof Function);
assert.equal("A done", a.A()); assert.equal("A done", a.A());

Loading…
Cancel
Save