Skip to main content

@rbxts/expect > Assertion > throw

Assertion.throw() method

Asserts that the function throws an exception.

Signature:

throw(): Assertion<T>;

Returns:

Assertion<T>

Example

expect(buyPet).to.throw();