busterjs / buster

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

Timeout #405

Closed silentorb closed 10 years ago

silentorb commented 10 years ago

The documentation says "When an asynchronous test runs for more than timeout ms, the runner will abort it and emit a test:timeout event."

That implies test:timeout will not affect synchronous tests. However, when I extend the timeout property the test pauses for that length of time even if the test is synchronous. This is also the case when I use when.js promises that successfully resolve.

var buster = require("buster");
var assert = buster.referee.assert;
var when = require('when');

buster.testCase("Simple test", {
    setUp: function () {
        this.timeout = 10000;
    },
    "always true": function () {
        assert(true);
    },
    "using promises": function () {
        var def = when.defer();
        setTimeout(function () {
            assert(true);
            def.resolve();
        }, 10);
        return def.promise;
    }
});

When I run "always true" or "using promises" either individually or together, the tester will pause for ten seconds.

This is with Buster 0.7.11.

dwittner commented 10 years ago

That's strange. I can't reproduce this weird behaviour, neither with buster 0.7.11 nor with 0.7.13. Can you please reinstall buster and try again? Do you use a local or global installation of buster and on which OS? What does your buster.js file look like and how do you run your tests?

silentorb commented 10 years ago

I'm using both a global and local install of buster on WIndows 7. I uninstalled and reinstalled it both globally and locally and that has seemed to fix the problem, so something must have gone wrong with my files.

Thank you for your time!