All Topics
All Topics
Technology
Technology
Design
Design
Programming
Programming
Science
Science
News
News
Gaming
Gaming
Entertainment
Entertainment
Business
Business
Finance
Finance
Sports
Sports
Health
Health
Food
Food
Travel
Travel
Art
Art
Music
Music
Books
Books
Education
Education
Politics
Politics
Personal
Personal
No algorithm. No AI slop. No ads. Just RSS. Pro-human. Indie writers. Real journalism. Open web. Chronological. Hand toasted.

Jane Street's Expect Tests: Making Test-Writing a Joyful, Interactive Experience

By

ryanhn

3mo ago· 11 min readenInsight

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 pulled
At 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'.
Snippet from the RSS feed
At 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 ...

You might also wanna read