Mark As Completed Discussion

Local Dev & Testing

  • Handlers as pure functions: write them so they can be called locally with fake events.
  • Unit tests: pass in fixture events/contexts.
  • Contract tests: validate JSON schemas for events/payloads.
  • Emulate schedules and queues with small drivers.
JAVASCRIPT
1// hello_test.js (super lightweight "test" without frameworks)
2const { handler } = require("./lambda_hello");
3
4(async () => {
5  const res = await handler({ path: "/test" }, { requestId: "t1" });
6  console.log("status", res.statusCode);
7  console.log("ok", res.body.includes("Hello"));
8})();