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

18 lines
424 B
JavaScript

var s = process.http.createServer(function (req, res) {
var body = "exports.A = function() { return 'A';}";
res.sendHeader(200, [
["Content-Length", body.length],
["Content-Type", "text/plain"]
]);
res.sendBody(body);
res.finish();
});
s.listen(8000);
process.mixin(require("../common.js"));
var a = require("http://localhost:8000/")
assertInstanceof(a.A, Function);
assertEquals("A", a.A());
s.close();