Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

mark async tests done correctly

  • Loading branch information...
commit 9a4eb392ad772794060a871958f35a68682e49a6 1 parent 41036db
Rebecca Murphey authored
Showing with 8 additions and 2 deletions.
  1. +8 −2 tests/app/async.js
10 tests/app/async.js
View
@@ -4,17 +4,23 @@ define([
describe("async behavior", function() {
it("you should understand how to use 'promises' to handle asynchronicity", function(done) {
var flag = false;
+ var finished = 0;
+ var total = 2;
+
+ function finish(done) {
+ if (++finished == total) { done(); }
+ }
answers.async(true).then(function(result) {
flag = result;
expect(flag).to.be(true);
- done();
+ finish(done);
});
answers.async('success').then(function(result) {
flag = result;
expect(flag).to.be('success');
- done();
+ finish(done);
});
expect(flag).to.be(false);
Please sign in to comment.
Something went wrong with that request. Please try again.