Skip to content

Commit

Permalink
Add another non-triggering scenario
Browse files Browse the repository at this point in the history
  • Loading branch information
JCake committed Feb 18, 2024
1 parent e3dbaf8 commit be57115
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pizza-function/reports/mutation/mutation.html

Large diffs are not rendered by default.

15 changes: 14 additions & 1 deletion pizza-function/src/lambdas.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,21 @@
import { test, expect } from "vitest";
import { handler } from "./lambda";

test('runs function', async () => {
test('Does not trigger event when no data', async () => {
const result = await handler({detail:{}}, {} as any, () => {});
expect(result.statusCode).toBe(200);
expect(result.body).toBe('{"message":"Did not trigger event"}');
});

test('Does not trigger event when not at Arlington', async () => {
const input = {
detail:{
EventType: 'EXIT',
GeofenceId: 'Somewhere Random',
SampleTime: '2024-02-17T22:23:24Z'
}
};
const result = await handler(input, {} as any, () => {});
expect(result.statusCode).toBe(200);
expect(result.body).toBe('{"message":"Did not trigger event"}');
});

0 comments on commit be57115

Please sign in to comment.