v4.0.0
Breaking changes
New scoped assertion API
Every assertion is now result.<scope>.<predicate>() with .not for negation:
result.exitCode.toBe(0)
result.status.toBe(201)
result.stdout.toContain("Build completed")
result.stderr.not.toContain("error")
result.stderr.toContain("rule", { near: "file.ts" }) // proximity check
result.file("dist/index.js").toExist()
result.file("dist/index.cjs").not.toExist()
result.file("dist/index.js").toContain("Hello")
result.response.toMatchFile("expected.json")
await result.table("users").toMatch({ columns, rows })Migration from 3.x
| 3.x | 4.0 |
|---|---|
result.expectStatus(200) |
result.status.toBe(200) |
result.expectExitCode(0) |
result.exitCode.toBe(0) |
result.expectStdoutContains("x") |
result.stdout.toContain("x") |
result.expectFile("path") |
result.file("path").toExist() |
result.expectNoFile("path") |
result.file("path").not.toExist() |
result.expectFileContains("p", "x") |
result.file("p").toContain("x") |
result.expectResponse("f.json") |
result.response.toMatchFile("f.json") |
await result.expectTable("t", opts) |
await result.table("t").toMatch(opts) |