Skip to content

Commit

Permalink
fix(MockServer): handle cases where incomplete data is received
Browse files Browse the repository at this point in the history
  • Loading branch information
mbroadst committed Nov 4, 2015
1 parent c7ec6ea commit 45ecd2d
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions test/unit/mocks/server.js
Expand Up @@ -74,6 +74,7 @@ MockServer.prototype._checkExpectations = function(data) {
var idx = 0;
var expectedFrame = this._expectedFrames.shift();
while (true) {
if (data.length <= idx + expectedFrame.length) break;
if (expectedFrame === false || expectedFrame === undefined) break;
var actualFrame = data.slice(idx, idx + expectedFrame.length);
debug('expected(', expectedFrame.length, '): ' + expectedFrame.toString('hex'));
Expand Down

0 comments on commit 45ecd2d

Please sign in to comment.