Skip to content

Commit

Permalink
fix(TestScheduler): flush expectations correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
TPReal authored and cartant committed Jul 9, 2018
1 parent ce52394 commit 66eb866
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/internal/testing/TestScheduler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,17 +141,14 @@ export class TestScheduler extends VirtualTimeScheduler {
}

super.flush();
const { flushTests } = this;
const flushTestsCopy = flushTests.slice();

for (let i = 0, l = flushTests.length; i < l; i++) {
const test = flushTestsCopy[i];
this.flushTests = this.flushTests.filter(test => {
if (test.ready) {
// remove it from the original array, not our copy
flushTests.splice(i, 1);
this.assertDeepEqual(test.actual, test.expected);
return false;
}
}
return true;
});
}

/** @nocollapse */
Expand Down

0 comments on commit 66eb866

Please sign in to comment.