finds.dev← search

// the find

mjackson/expect

★ 2,271 · JavaScript · MIT · updated May 2018

Write better assertions

The original standalone `expect` assertion library by mjackson, before it was donated to Jest in 2017. It offered a fluent chainable API for writing test assertions without Chai's overhead. This repo is now a historical artifact — v21+ development moved to facebook/jest.

The chainable API design was genuinely clean — `expect(3.14).toExist().toBeLessThan(4)` reads well. The `toMatch` supporting both RegExp on strings and partial object matching via tmatch was a useful dual-mode design. The extension API (`expect.extend`) let teams add custom matchers without forking. Built-in spy functionality in the same package meant one fewer dependency for simple test setups.

Abandoned since 2018 — last push is May 2018 and the README explicitly tells you to migrate away. The spy implementation is synchronous-only with no async support, which is a wall you hit fast with modern Promise-heavy code. Error messages on failure are bare-bones compared to what Jest's expect now produces with diff output. Installing this today means inheriting a dependency tree frozen in 2017 (babel 6 era) that will conflict with anything modern.

View on GitHub →

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →