Fix 'sent' assertion
We were completely mishandling the length of the data. Make sure we look at the length of the websocket rather than the websock object, and also compare with the expected length.
This commit is contained in:
parent
cf0236de18
commit
b1538a0fa4
|
@ -37,10 +37,14 @@ chai.use(function (_chai, utils) {
|
||||||
};
|
};
|
||||||
var data = obj._websocket._get_sent_data();
|
var data = obj._websocket._get_sent_data();
|
||||||
var same = true;
|
var same = true;
|
||||||
for (var i = 0; i < obj.length; i++) {
|
if (data.length != target_data.length) {
|
||||||
if (data[i] != target_data[i]) {
|
same = false;
|
||||||
same = false;
|
} else {
|
||||||
break;
|
for (var i = 0; i < data.length; i++) {
|
||||||
|
if (data[i] != target_data[i]) {
|
||||||
|
same = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!same) {
|
if (!same) {
|
||||||
|
|
Loading…
Reference in New Issue