Skip to content

Instantly share code, notes, and snippets.

@mtimbs
mtimbs / SQSRecordFactory.ts
Created March 11, 2020 00:32
Utility for generating fake SQS Records to help with Unit/Integration testing
import { v4 as uuidv4 } from 'uuid';
import { SQSRecord } from 'aws-lambda';
const now = Math.round((new Date()).getTime() / 1000).toString();
export default (params?: Partial<SQSRecord>): SQSRecord => ({
messageId: uuidv4(),
receiptHandle: uuidv4(),
body: '',