This PR simplifies the MockStoreForMiddleware a little bit (the count was redundant), which lets us improve the naming. As well, simplify our middleware test action type guards using XCTUnwrap, which throws (and cancels the test execution) if the unwrapped action is the incorrect type. That means we mark our unit tests with the throw keyword.
Demo
Here is an example of what it looks like if a test fails due to an incorrect type being dispatched to the store. Note that we can still easily use the type to access the action's variables with this method.
:pencil: Checklist
You have to check all boxes before merging
[x] Filled in the above information (tickets numbers and description of your work)
:scroll: Tickets
Jira ticket Github issue
:bulb: Description
This PR simplifies the
MockStoreForMiddleware
a little bit (the count was redundant), which lets us improve the naming. As well, simplify our middleware test action type guards using XCTUnwrap, which throws (and cancels the test execution) if the unwrapped action is the incorrect type. That means we mark our unit tests with thethrow
keyword.Demo
Here is an example of what it looks like if a test fails due to an incorrect type being dispatched to the store. Note that we can still easily use the type to access the action's variables with this method.
:pencil: Checklist
You have to check all boxes before merging
@Mergifyio backport release/v120
)