161. toBe() or not.toBe()

JavaScript Meta

medium  - accepted / - tried

Here are some simple Jest test code.

expect(3).toBe(3) // ✅expect(4).toBe(3) // ❌

We can reverse it with not.

expect(3).not.toBe(3) // ❌expect(4).not.toBe(3) // ✅

Please implement myExpect() to support toBe() and also not.

Always try to find a better approach.