@rbxts/expect > Assertion > include
Assertion.include() method
Asserts that the expectedValue
is a value in the array.
Signature:
include(expectedValue: InferArrayElement<T>): this;
Parameters
Parameter | Type | Description |
---|---|---|
expectedValue | A value that should be included in the array. |
Returns:
this
Remarks
The value is looked for in a shallow context.
For strings, use the substring method.
Example
expect([1,2,3]).to.include(1);
expect([1]).to.not.include(2);