From 6b9e5eedf2fadbd192e9be522ea51bd8fd02bb71 Mon Sep 17 00:00:00 2001 From: Urban Hafner Date: Tue, 16 Jun 2009 08:20:00 +0200 Subject: [PATCH] Test for remote module loading --- test/test-remote-module-loading.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 test/test-remote-module-loading.js diff --git a/test/test-remote-module-loading.js b/test/test-remote-module-loading.js new file mode 100644 index 0000000000..a913dabfd9 --- /dev/null +++ b/test/test-remote-module-loading.js @@ -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()); + +} \ No newline at end of file