Cleanup logs during test (#1787)

This commit is contained in:
BrennanConroy 2018-03-30 13:33:59 -07:00 committed by GitHub
parent 0362905a70
commit c0418319fe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 6 deletions

View File

@ -136,6 +136,7 @@ describe("HttpConnection", () => {
it("start throws after all transports fail", async (done) => {
const options: IHttpConnectionOptions = {
...commonOptions,
httpClient: new TestHttpClient()
.on("POST", (r) => ({ connectionId: "42", availableTransports: [] }))
.on("GET", (r) => { throw new Error("fail"); }),
@ -343,14 +344,14 @@ describe("HttpConnection", () => {
describe("startAsync", () => {
it("throws if no TransferFormat is provided", async () => {
// Force TypeScript to let us call start incorrectly
const connection: any = new HttpConnection("http://tempuri.org");
const connection: any = new HttpConnection("http://tempuri.org", commonOptions);
expect(() => connection.start()).toThrowError("The 'transferFormat' argument is required.");
});
it("throws if an unsupported TransferFormat is provided", async () => {
// Force TypeScript to let us call start incorrectly
const connection: any = new HttpConnection("http://tempuri.org");
const connection: any = new HttpConnection("http://tempuri.org", commonOptions);
expect(() => connection.start(42)).toThrowError("Unknown transferFormat value: 42.");
});

View File

@ -233,7 +233,6 @@ describe("HubConnection", () => {
connection.receive({
arguments: ["test"],
invocationId: "0",
nonblocking: true,
target: "message",
type: MessageType.Invocation,
@ -273,7 +272,7 @@ describe("HubConnection", () => {
it("all handlers can be unregistered with just the method name", async () => {
const connection = new TestConnection();
const hubConnection = new HubConnection(connection);
const hubConnection = new HubConnection(connection, commonOptions);
connection.receiveHandshakeResponse();
@ -306,7 +305,7 @@ describe("HubConnection", () => {
it("a single handler can be unregistered with the method name and handler", async () => {
const connection = new TestConnection();
const hubConnection = new HubConnection(connection);
const hubConnection = new HubConnection(connection, commonOptions);
connection.receiveHandshakeResponse();
@ -339,7 +338,7 @@ describe("HubConnection", () => {
it("can't register the same handler multiple times", async () => {
const connection = new TestConnection();
const hubConnection = new HubConnection(connection);
const hubConnection = new HubConnection(connection, commonOptions);
connection.receiveHandshakeResponse();