feat: add SQS + EventBridge

This commit is contained in:
Zakaria
2026-09-24 22:34:04 -04:00
parent 9bbe80b5f2
commit 1b129e9dcf
37 changed files with 2902 additions and 66 deletions
@@ -2,7 +2,7 @@ import {describe, expect, test} from 'bun:test'
import {execFile} from 'node:child_process'
import {rm, writeFile} from 'node:fs/promises'
import {tmpdir} from 'node:os'
import {createZipArchive, crc32, handlerFileName} from './zipArchive'
import {createZipArchive, crc32, handlerFileName, readStoredZipEntry} from './zipArchive'
describe('crc32', () => {
// Reference values from the standard CRC-32 (IEEE 802.3) test vectors.
@@ -15,6 +15,12 @@ describe('crc32', () => {
})
describe('createZipArchive', () => {
test('reads a stored source file from an archive', () => {
const archive = createZipArchive([{name: 'index.js', content: 'exports.handler = async () => ({})'}])
expect(readStoredZipEntry(archive, 'index.js')).toBe('exports.handler = async () => ({})')
expect(readStoredZipEntry(archive, 'missing.js')).toBeNull()
})
test('writes the ZIP magic number and end-of-central-directory record', () => {
const archive = createZipArchive([{name: 'index.js', content: 'module.exports = 1'}])
const view = new DataView(archive.buffer, archive.byteOffset, archive.byteLength)