🎭
toBe
or not.toBe(), that is the question
This comparison is used for comparing data using the == operator. In AssemblyScript this operator is used for comparing strings, numbers, and exact reference equality (or pointer comparison.)
For example, the following statements are valid toBe assertions:
1
let a = new Vec3(1, 2, 3);
2
3
// same reference
4
expect(a).toBe(a);
5
6
// integers are the same
7
expect(10).toBe(10);
8
9
// floats
10
expect(3.14).toBe(3.14);
11
12
// nullable references
13
expect<Vec3 | null>(null).toBe(null);
Copied!
This method is safe to use portably with jest.
Last modified 1yr ago
Copy link