Test for remote module loading

pull/23362/head
Urban Hafner 2009-06-16 08:20:00 +02:00
parent 7cce31d4e4
commit 6b9e5eedf2
1 changed files with 18 additions and 0 deletions

View File

@ -0,0 +1,18 @@
new node.http.Server(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();
}).listen(8000);
include("mjsunit.js");
var a = require("http://localhost:8000/")
function onLoad() {
assertInstanceof(a.A, Function);
assertEquals("A", a.A());
}