---
title: "Writing and testing event-driven projections with Emmett, Pongo and PostgreSQL"
url: https://daily.dev/posts/writing-and-testing-event-driven-projections-with-emmett-pongo-and-postgresql-uliw9rmkt
source_url: https://event-driven.io/en/emmett_projections_testing
type: article
source: "Event-Driven by Oskar Dudycz"
published: 2026-06-17T11:26:00.842Z
updated: 2026-06-17T11:31:40.631Z
tags: ["architecture", "typescript", "postgresql"]
reading_time: 11
upvotes: 0
comments: 0
language: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Writing and testing event-driven projections with Emmett, Pongo and PostgreSQL

**[Event-Driven by Oskar Dudycz](https://daily.dev/sources/event-driven-io)** · 11 min read · 0 upvotes · 0 comments

## Summary

A hands-on guide to building and testing event-driven projections using Emmett, Pongo, and PostgreSQL in Node.js. Covers defining event types for a shopping cart domain, creating single-stream projections that materialize read models into PostgreSQL JSONB collections, and registering them as inline projections (transactional with event appends). Also demonstrates a BDD-style testing approach using PostgreSQL TestContainers, with Given/When/Then helpers to verify read model creation, updates, and deletion when events like ShoppingCartConfirmed return null from the evolve function.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://event-driven.io/en/emmett_projections_testing>

## Similar posts on daily.dev

- [Consumers, projectors, reactors and all that messaging jazz in Emmett](https://daily.dev/posts/consumers-projectors-reactors-and-all-that-messaging-jazz-in-emmett-ie8ierv12) · Architecture Weekly · 0 upvotes · 0 comments

---

Tags: [#architecture](https://daily.dev/tags/architecture), [#typescript](https://daily.dev/tags/typescript), [#postgresql](https://daily.dev/tags/postgresql)

[View this post on daily.dev](https://daily.dev/posts/writing-and-testing-event-driven-projections-with-emmett-pongo-and-postgresql-uliw9rmkt)
