Jane Street's Expect Tests: Making Test-Writing a Joyful, Interactive Experience
By
ryanhn
Toasted golden, schmeared with insight. Top of the rack.
Summary
Jane Street's 'expect tests' library transforms test-writing into a joyful, interactive experience similar to REPL sessions or Jupyter notebooks. These snapshot-style tests provide rapid feedback cycles that make testing feel tactile and exploratory. The approach has influenced similar tools in other languages like Rust's expect-test and JavaScript's Jest, and was itself inspired by Mercurial's unified testing format and 'cram' testing.
Key quotes
· 4 pulledAt Jane Street we use a pattern/library called 'expect tests' that makes test-writing feel like a REPL session, or like exploratory programming in a Jupyter notebook—with feedback cycles so fast and joyful that it feels almost tactile.
Having used them for some time now this is the only way I'd ever want to write tests.
Other languages call these 'snapshot' tests—see for example Rust's expect-test, which seems to have been inspired by our library, or Javascript's Jest.
We were first put onto the idea ourselves by Mercurial's unified testing format, and so-called 'cram'.
You might also wanna read
Why Average LLM Use Is Likely Destroying Value in Software Development
The author argues that, contrary to prevailing hype, the average use of Large Language Models (LLMs) is likely destroying value rather than
How AI Accelerated Prototyping: From Idea to Tangible in Record Time
The author reflects on how AI has transformed their prototyping workflow. Previously, the biggest bottleneck was the time needed to scaffold
GitLab 19.0 launches with Secrets Manager, agentic workflows, and self-hosted AI models
GitLab 19.0 has been released, positioning itself as an intelligent orchestration platform for DevSecOps. The release includes expanded secr
bit.ly·1d agoCentralizing Error Handling in Rust with Custom AppError Enums
This article discusses the importance of centralizing error handling in Rust applications using a custom AppError enum combined with map_err
Zig Devlog: Build System Rework Separates Maker and Configurer Processes
This devlog entry from the Zig programming language project announces a major rework of the build system, separating the maker process from
Study finds most developers refuse to code without AI, raising quality concerns
A February 2026 study by AI research lab METR reveals that most developers now refuse to work without AI coding tools. While these tools hel
