Skip to content

assertcheck v0.5.15


assertcheck / AssertOptions

Interface: AssertOptions

Defined in: src/types.ts:32

Options accepted by every assertion function.

Remarks

All fields are optional. You can pass a plain string as a shorthand for { msg: "..." }.

Example

ts
// Shorthand string
assert.equal(a, b, "values must match")

// Full options object
assert.equal(a, b, {
  msg:    "order status mismatch",
  actual: "order.status",
  note:   "call resetOrder() before retrying",
})

Properties

PropertyTypeDescriptionDefined in
actual?stringLabel for the actual value in the error output. Useful to identify which variable or field failed. Example "order.status"`, `"response.body.user.age"src/types.ts:44
msg?stringHuman-readable description of what the assertion checks. Appears as the title in the formatted error block.src/types.ts:37
note?stringAdditional context about why this assertion exists or how to fix it. Displayed in the note section of the error block. Example "Call resetOrder() before retrying"src/types.ts:51

Released under the Apache 2.0 License. Built by Vagabond Studio — senior-only for growing companies.