async test with proxy problem

3 views
Skip to first unread message

xiaoh...@gmail.com

unread,
Jul 14, 2014, 10:40:50 AM7/14/14
to buster...@googlegroups.com
my buster.js:

var config = module.exports;

config["My tests"] = {
    environment: "browser",  // or "node"
    rootPath: "../",
    sources: [
        "lib/*.js"      // Paths are relative to config file
    ],
    tests: [
        "test/*-test.js"
    ],
    resources: [{
        path: "/app/list",
        backend: "http://my.server.com/app/list"
    }]
};

my-test.js:

var assert = buster.referee.assert;
var refute = buster.referee.refute;

(function () {
    buster.testCase("my-test", {
        "should get some data back": function (done) {
            this.timeout = 1500;
            var loader = new net.Request(buster.env.contextPath + '/app/list/', done( function(){assert(true);}) );
        }
    });
}());

Running this test always times out. The server log says the request has been made to my real server, so buster's proxy did make the request, but it seems proxy server never returns data to the XMLHttpRequest object? I tried using different calls to done(), like making the callback function a anonymous function in which I call assert(true) and done() -- same result: time out.

What did I do wrong?
Reply all
Reply to author
Forward
0 new messages