tst

Minimal test runner — open DevTools console to see results

Options

Default ?mute ?bail ?grep=async ?format=tap

💡 URL params: ?grep=pattern ?mute ?bail ?format=tap
💡 Node env: TST_GREP=pattern TST_MUTE=1 TST_BAIL=1 TST_FORMAT=tap

Assertions

  • ok(value) — value is truthy
  • is(a, b) — a equals b (deep)
  • not(a, b) — a differs from b
  • same(a, b) — arrays have same items
  • any(val, list) — value is in list
  • throws(fn, match?) — function throws
  • almost(a, b, eps?) — floats are close

Modifiers

  • test(name, fn) — define a test
  • test.skip(name, fn) — skip this test
  • test.only(name, fn) — run exclusively
  • test.todo(name, fn?) — mark as planned
  • test.mute(name, fn) — suppress output
  • test.demo(name, fn) — ignore failures
  • test.run({ timeout, ...options }) — manually run tests