@@ -158,15 +158,19 @@ Never pull `ts-pattern` or `vitest` into core.
158158 a zero-dependency exhaustive fold whose handler object is
159159 ` { Ok, Defect } & { [K in E["_tag"]]: (e: Extract<E, {_tag: K}>) => R } ` .
1601603 . ✅ ** ` packages/vitest ` ** — Done. Custom matchers ` toBeOk ` , ` toBeOkWith ` ,
161- ` toBeErr ` , ` toBeErrTagged ` , ` toBeDefect ` , registered via ` expect.extend ` and
162- augmenting Vitest's ` Matchers ` interface. They detect a thenable ` AsyncResult `
163- and await internally, so a test reads ` await expect(asyncResult).toBeOk() `
164- (the required ` await ` is documented loudly — a forgotten one passes silently).
165- 4 . ✅ ** ` packages/pattern ` ** — Done. Thin ` ts-pattern ` integration: ` tag(t) `
166- sugar (the ` { _tag: t } ` pattern, narrowing to the variant + payload) and
167- ` toMatchable(result) ` exposing the ok/err/defect channels as a ` _kind `
168- discriminated union. Kept small — the power is ts-pattern's; ` matchTags `
169- covers the everyday exhaustive case.
161+ ` toBeErr ` , ` toBeErrTagged ` (optional second arg also matches the tagged
162+ error's payload — exact for a plain object, partial for an asymmetric matcher
163+ like ` expect.objectContaining ` ), ` toBeDefect ` , registered via ` expect.extend `
164+ and augmenting Vitest's ` Matchers ` interface. They detect a thenable
165+ ` AsyncResult ` and await internally, so a test reads
166+ ` await expect(asyncResult).toBeOk() ` (the required ` await ` is documented loudly
167+ — a forgotten one passes silently).
168+ 4 . ✅ ** ` packages/pattern ` ** — Done. Because ` Result ` is a discriminated union
169+ (Thesis #1 / Public surface), ` ts-pattern ` matches it natively — this package
170+ is thin sugar: pattern constructors ` P.ok ` /` P.err ` /` P.defect ` (returning the
171+ ` { tag: … } ` object patterns) plus ` tag(t) ` (the ` { _tag: t } ` pattern,
172+ narrowing to the variant + payload). Kept small — the power is ts-pattern's;
173+ ` matchTags ` covers the everyday exhaustive case.
170174
171175Also shipped: a root ` README ` + ` LICENSE ` , per-package READMEs, and the VitePress
172176docs site (guide + generated API reference). ** Remaining work is manual** and
0 commit comments