Created
November 6, 2019 00:01
-
-
Save furlanf/2e65b247ed59e7ced3894de80ad98d0f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe("when send an invalid user", () => { | |
it("returns unauthorized", async () => { | |
const handler = middy(async (event, context) => {}); | |
handler.use(vegetableCompany()); | |
const event = { requestContext: { user: { company: "fruit-company" } } }; | |
const { statusCode } = await handler(event, {}); | |
expect(statusCode).toEqual(401); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment