How to mix Jest expect with Detox expect? Here is what I try to do. It seem expect
has overrided the jest expect
.
await mockServer.mockAnyResponse({
httpRequest: {
method: 'POST',
path: '/api/register',
},
httpResponse: {
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
token: 'xxx',
}),
}
});
await element(by.id('name')).typeText('Robert');
await element(by.id('password')).typeText('123456');
await element(by.id('register')).tap();
// Check if endpoint has been called
let result = await mockServer.checkIfRegisterEndPointHasBeenCalled();
expect(result).toBe(true); // <-- how to do something like this?