📦
toContainEqual
Check if something contains something using strict equality
This comparison is used to determine if a reference contains a reference that equals another reference.
All the values returned by T[index] will be compared using the == operator, and if that comparison does not work, a memcompare will be used. 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 reference = new Vec3(1, 2, 3);
2
const data = new Array<Vec3>(0);
3
data.push(new Vec(0, 0, 0));
4
data.push(new Vec(1, 2, 3));
5
data.push(new Vec(4, 5, 6));
6
7
expect<Uint8Array>(data).toContainEqual(reference);
Copied!
This method is portable with jest using the toContainEqual() method.
Last modified 1yr ago
Copy link