* Process pending requests and verify there are no outstanding expectations. Also fails * if no requests are pending.
()
| 54 | * if no requests are pending. |
| 55 | */ |
| 56 | flush() { |
| 57 | if (this._requests.length === 0) { |
| 58 | throw new Error('No pending requests to flush'); |
| 59 | } |
| 60 | |
| 61 | do { |
| 62 | this._processRequest(this._requests.shift()!); |
| 63 | } while (this._requests.length > 0); |
| 64 | |
| 65 | this.verifyNoOutstandingExpectations(); |
| 66 | } |
| 67 | |
| 68 | /** |
| 69 | * Throw an exception if any expectations have not been satisfied. |
no test coverage detected