Skip to main content

@rbxts/expect > Assertion > throws

Assertion.throws() method

Asserts that the function throws an exception.

Signature:

throws(): Assertion<T>;

Returns:

Assertion<T>

Remarks

Type alias for the throw version of this.

Example

expect(buyPet).to.be.a.function().that.throws();