Skip to content

Commit 40b7e18

Browse files
committed
test: add size checks
1 parent 26ebc5b commit 40b7e18

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

src/cmap/connection.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -828,11 +828,6 @@ export class SizedMessageTransform extends Transform {
828828

829829
callback();
830830
}
831-
832-
override pipe<T extends NodeJS.WritableStream>(destination: T, options?: { end?: boolean }): T {
833-
destination.on('drain', this.emit.bind('drain'));
834-
return super.pipe(destination, options);
835-
}
836831
}
837832

838833
/** @internal */

test/unit/cmap/connection.test.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ describe('new Connection()', function () {
323323
});
324324
});
325325

326-
describe.only('SizedMessageTransform', function () {
326+
describe('SizedMessageTransform', function () {
327327
it('parses chunks of wire messages', function () {
328328
const stream = new SizedMessageTransform({ connection: {} as any });
329329
// Message of length 4 + 4 = 8
@@ -341,7 +341,8 @@ describe('new Connection()', function () {
341341
const stream = new SizedMessageTransform({ connection: {} as any });
342342

343343
let dataCount = 0;
344-
stream.on('data', () => {
344+
stream.on('data', chunk => {
345+
expect(chunk).to.have.lengthOf(8);
345346
dataCount += 1;
346347
});
347348

@@ -361,7 +362,8 @@ describe('new Connection()', function () {
361362
const stream = new SizedMessageTransform({ connection: {} as any });
362363

363364
let dataCount = 0;
364-
stream.on('data', () => {
365+
stream.on('data', chunk => {
366+
expect(chunk).to.have.lengthOf(8);
365367
dataCount += 1;
366368
});
367369

0 commit comments

Comments
 (0)