Skip to main content

@rbxts/expect > Assertion > typeOf

Assertion.typeOf() method

Asserts that the value is of type typeName.

Signature:

typeOf<I extends keyof CheckableTypes>(name: I): Assertion<I>;

Parameters

Parameter

Type

Description

name

I

Returns:

Assertion<I>

Remarks

The type is checked via typeOf.

Type alias for the instanceOf version of this.

Example

expect(1).to.be.an.instanceOf("number");
expect(new Vector3()).to.be.an.instanceOf("Vector3");