Skip to main content

@rbxts/expect > Assertion > key

Assertion.key() method

Asserts that the table has the key key.

Signature:

key(key: string): this;

Parameters

Parameter

Type

Description

key

string

Name of the key that the table should have.

Returns:

this

This instance for chaining.

Example

expect({ name: "Daymon" }).to.have.the.key("name");