| 84 | } |
| 85 | |
| 86 | done_() { |
| 87 | if (this.expectedAsserts_ === -1) { |
| 88 | let message = "Please call t.plan(count) to initialize test harness " + |
| 89 | "with correct assert count (Note: count > 0)"; |
| 90 | %AbortJS(message); |
| 91 | } |
| 92 | |
| 93 | if (this.expectedAsserts_ !== this.actualAsserts_) { |
| 94 | let message = "Expected asserts: " + this.expectedAsserts_; |
| 95 | message += ", Actual asserts: " + this.actualAsserts_; |
| 96 | message += "\nin test: " + this.name_; |
| 97 | message += "\n" + Function.prototype.toString.apply(this.test_); |
| 98 | %AbortJS(message); |
| 99 | } |
| 100 | } |
| 101 | } |
| 102 | |
| 103 | /** This is used to test async functions and promises. |