Skip to content
masterclass Buddy

Vitest · Matcher

toBeNumber

toBeNumber is an expectTypeOf matcher that checks whether a value has the static TypeScript type number. It is used in Vitest type tests, which the compiler analyzes instead of running.

Last updated

Syntax

expectTypeOf(value).toBeNumber()

In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.

Subscribe
  • expectTypeOf
  • toBeString
  • toBeVoid
  • assertType
  • *.test-d.ts

Source: Testing Types | Guide | Vitest. Checked 2026-11-03.