You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This was working a couple of weeks back so I'm unsure why it's failing now. Essentially I'm writing a test case that a thunk fails when I expected it to.
test("The user should not be signed up if they provide an invalid email", async () => {
const invalidUser = {
...signUpUser,
email: "[email protected]",
};
expect(mockAuthService.signUp).not.toHaveBeenCalled();
await expect(
store.getActions().user.signUp(invalidUser)
).rejects.toThrow(Error("The email provided was not valid."));
expect(mockAuthService.signUp).not.toHaveBeenCalled();
expect(store.getMockedActions()).toEqual(
expect.arrayContaining([
{
type: "@thunk.user.signUp(fail)",
payload: invalidUser,
error: Error("The email provided was not valid."),
},
])
);
});
The text was updated successfully, but these errors were encountered:
LuisOsta
changed the title
getMockedActions returning start element for thunk but not fail when the thunk throws an error
getMockedActions returning "@thunk.<thunk_name>(start)" type thunk but not "@thunk.<thunk_name>(fail)" when the thunk throws an error
Oct 26, 2020
The Problem
This was working a couple of weeks back so I'm unsure why it's failing now. Essentially I'm writing a test case that a thunk fails when I expected it to.
As it's shown in the tutorial.
The store.getMockedActions() should return both the start of the thunk and the failed state of the thunk (if it fails).
Kinda like this (abbreviated example from the tutorial:
But what I get from the functions is this:
The Question
Do you have a sense of what could be causing this issue?
And if there's anything recent that could be causing it?
More Information
Test Runner
Store Configuration
Test Case In Question
The text was updated successfully, but these errors were encountered: