diff --git a/src/IncomingMessage.js b/src/IncomingMessage.js index 2078216..dfaea45 100644 --- a/src/IncomingMessage.js +++ b/src/IncomingMessage.js @@ -37,8 +37,7 @@ function createConnectionObject(context) { */ function sanitizeContext(context) { const sanitizedContext = { - ...context, - log : context.log.bind(context) + ...context }; // We don't want the developper to mess up express flow diff --git a/test/ExpressAdapter.test.js b/test/ExpressAdapter.test.js index 8e9f299..cdb89ff 100644 --- a/test/ExpressAdapter.test.js +++ b/test/ExpressAdapter.test.js @@ -1,7 +1,5 @@ import { ExpressAdapter } from "../src"; -const NOOP = () => {}; - describe("ExpressAdapter", () => { it("Should work", done => { @@ -16,7 +14,6 @@ describe("ExpressAdapter", () => { }); const context = { - log : NOOP, bindings : { req: { originalUrl: "http://foo.com/bar" } }, done : () => { expect(listenerCalled).toBe(true); @@ -48,7 +45,6 @@ describe("ExpressAdapter", () => { }); const context = { - log : NOOP, bindings : { req: { originalUrl: "http://foo.com/bar" } }, done : () => { expect(listenerCalled).toBe(true); diff --git a/test/IncomingMessage.test.js b/test/IncomingMessage.test.js index 8c14ad5..4326cc3 100644 --- a/test/IncomingMessage.test.js +++ b/test/IncomingMessage.test.js @@ -10,8 +10,7 @@ describe("IncomingMessage", () => { originalUrl : "https://foo.com/bar", headers : { "x-forwarded-for": "192.168.0.1:57996" } } - }, - log : () => {} + } }; const req = new IncomingMessage(context); @@ -34,8 +33,7 @@ describe("IncomingMessage", () => { req : { originalUrl : "http://foo.com/bar" } - }, - log : () => {} + } }; const req = new IncomingMessage(context); @@ -61,7 +59,6 @@ describe("IncomingMessage", () => { originalUrl : "http://foo.com/bar" } }, - log : () => {}, done : () => {} }; @@ -82,8 +79,6 @@ describe("IncomingMessage", () => { expect(req.context.invocationId).toBe(context.invocationId); expect(req.context.bindingData).toBe(context.bindingData); expect(req.context.bindings).toBe(context.bindings); - expect(req.context.log).not.toBe(context.log); - expect(req.context.log).toBeInstanceOf(Function); expect(req.context.done).toBeUndefined(); // We don't want to pass done }); diff --git a/test/expressIntegration.test.js b/test/expressIntegration.test.js index b4da748..1cbce29 100644 --- a/test/expressIntegration.test.js +++ b/test/expressIntegration.test.js @@ -19,7 +19,6 @@ describe("express integration", () => { // 3. Mock Azure Function context var context = { bindings : { req: { method: "GET", originalUrl: "https://lol.com/api/foo/bar" } }, - log : () => { throw new Error("Log should not be called"); }, done : (error) => { expect(error).toBeUndefined(); expect(context.res.status).toBe(200);