busterjs / buster

Abandoned - A powerful suite of automated test tools for JavaScript.
http://docs.busterjs.org
Other
448 stars 37 forks source link

Using a HTTP Proxy returns "undefined" #382

Closed teameh closed 9 years ago

teameh commented 10 years ago

I can't get the HTTP proxy working.

When I try to run the test I only get a undefined message

$ buster-test --verbose
Running tests: Browser tests
undefined
undefined

My config looks like this:

var config = exports;

config["Browser tests"] = {
    environment: "browser",
    sources: ["jquery.js"],
    tests: ["proxy-test.js"],
    resources: {
        "/en": "http://docs.busterjs.org:80/en/"
    }
};

My code can be found here: https://github.com/tiemevanveen/demos/tree/master/buster-proxy-tests I also created a stackoverflow question in case anyone over there knows the solution: http://stackoverflow.com/questions/19298135/buster-js-using-a-http-proxy-returns-undefined

augustl commented 10 years ago

Added a test: https://github.com/busterjs/ramp/commit/8093b17e38e2f548ba7005a4c62777981ca89f53

The test passes, so at least proxies works at the basic ramp level.

dwittner commented 9 years ago

@tiemevanveen, have you found a solution for your problem?

teameh commented 9 years ago

Nope, stopped working with this project

dwittner commented 9 years ago

You mean, you stopped working with Buster.JS? That's a pity. Maybe you still want to know, how to get your example up and running. The configuration has to be changed to:

var config = exports;

config["Browser tests"] = {
    environment: "browser",
    sources: ["jquery.js"],
    tests: ["proxy-test.js"],
    resources: [{
        path: "/en",
        backend: "http://docs.busterjs.org:80/en/"
    }]
};

See also this example in the docs. Then you can test something like this:

...
        $.ajax("en/latest/").done(done(function(evt) {

            assert.match(evt, "Welcome! Buster.JS is...");

        })).fail(function(evt) {
...