node/test/mjsunit/disabled/test-remote-module-loading.js

18 lines
418 B
JavaScript
Raw Normal View History

var s = node.http.createServer(function (req, res) {
2009-06-16 14:20:00 +08:00
var body = "exports.A = function() { return 'A';}";
res.sendHeader(200, [
["Content-Length", body.length],
["Content-Type", "text/plain"]
]);
res.sendBody(body);
res.finish();
2009-06-21 22:59:11 +08:00
});
s.listen(8000);
2009-06-16 14:20:00 +08:00
node.mixin(require("../common.js"));
2009-06-16 14:20:00 +08:00
var a = require("http://localhost:8000/")
2009-08-27 00:22:00 +08:00
assertInstanceof(a.A, Function);
assertEquals("A", a.A());
s.close();