Add missing properties to ClientHttp2StreamMock

This commit is contained in:
murgatroid99 2018-11-14 11:13:15 -08:00 committed by Nicolas "Pixel" Noble
parent 5fec89fc98
commit c06bbf6c48
1 changed files with 7 additions and 0 deletions

View File

@ -1,4 +1,5 @@
import * as assert from 'assert';
import {OutgoingHttpHeaders} from 'http';
import * as http2 from 'http2';
import {range} from 'lodash';
import * as stream from 'stream';
@ -46,6 +47,9 @@ class ClientHttp2StreamMock extends stream.Duplex implements
endAfterHeaders = false;
pending = false;
rstCode = 0;
readonly sentHeaders: OutgoingHttpHeaders = {};
readonly sentInfoHeaders?: OutgoingHttpHeaders[] = [];
readonly sentTrailers?: OutgoingHttpHeaders = undefined;
// tslint:disable:no-any
session: http2.Http2Session = {} as any;
state: http2.StreamState = {} as any;
@ -76,6 +80,9 @@ class ClientHttp2StreamMock extends stream.Duplex implements
this.emit('write', chunk);
cb();
}
sendTrailers(headers: OutgoingHttpHeaders) {
return this;
}
}
describe('CallStream', () => {