mirror of
https://github.com/nodejs/node-v0.x-archive.git
synced 2026-04-28 03:01:10 -04:00
Test for remote module loading
This commit is contained in:
18
test/test-remote-module-loading.js
Normal file
18
test/test-remote-module-loading.js
Normal 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());
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user