Since switching to NgRx's new action creator pattern in a fresh application, I've realized that I miss having a clearly defined type for actions. This becomes especially evident when testing services, as I want to ensure that the correct action with the right properties is dispatched.
How can I maintain type safety in TypeScript while addressing this issue?
Here's an illustrative example:
// In the line below, what should '???' be replaced with?
spyOn(store, "dispatch").and.callFake((action: ???) => {
expect(action.type).toBe(fetchProductStructureAction.type);
// Without the correct type, TypeScript flags an error here
expect(action.property).toBe(expectedProperty); // <--
})