This repository has been archived by the owner. It is now read-only.

async test returning resolved promise with truthy value is treated as an error #308

awwx opened this Issue Nov 15, 2012 · 2 comments


None yet
3 participants

awwx commented Nov 15, 2012

In this test script, the first test returns a resolved promise (indicating an async test) with an undefined value, and the test succeeds correctly.

The second test also returns a resolved promise, but this time with a defined value. Since the promise is resolved (successful), and there are no failed assertions, the test should be treated as successful. However, buster treats it as a failing test with an error.

For illustration I'm resolving with an object that has a "message" key (which is displayed as if buster is printing out error.message), but any truthy value will cause the test to fail.

[green checkmark] promise with undefined value

[yellow X] promise with truthy value
undefined: hi there

<!DOCTYPE html>
    <meta http-equiv="content-type" content="text/html; charset=utf-8">
    <script src=""></script>
    <script src=""></script>

      buster.testCase("async", {

        "promise with undefined value": function () {
          return when.resolve();

        "promise with truthy value": function () {
          return when.resolve({message: "hi there"});



This comment has been minimized.


cjohansen commented Nov 19, 2012

Buster seems to think that your resolved object is an error object. Which is stupid. I know why too, and it needs to be fixed.

@ghost ghost assigned cjohansen Nov 19, 2012


This comment has been minimized.


dwittner commented Sep 7, 2013

Fixed by 222b36148a.

@dwittner dwittner closed this Sep 7, 2013

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.