🎁
toContain
Check if something is contained in something
This comparison is used to determine if an Array contains a value.
All the values returned by T[index] will be compared using the == operator, so overloading the class @operator("==") can be used in conjunction with this comparison. The index must be a number value, and there must be a length property that matches the index type. All values from 0 to length - 1 will be checked.
1
const data = new Uint8Array(100);
2
data[5] = 255;
3
4
expect(data).toContain(255);
Copied!
This method is portable with jest using the toContain() method.
Last modified 1yr ago
Copy link