-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Closed
Description
I'm submitting a...
[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report
[x] Feature request
[ ] Documentation issue or request
[ ] Support request
What is the current behavior?
Currently, when you want to test a selector composed of other selectors you have to mock the state in a way that it satisfies all selectors.
The following is taken from here.
// tests for the first three selectors...
test("firstSelector unit test", () => { ... })
test("secondSelector unit test", () => { ... })
test("thirdSelector unit test", () => { ... })
// We have already tested the previous
// three selector outputs so we can just call `.resultFunc`
// with the values we want to test directly:
test("myComposedSelector unit test", () => {
// here instead of calling selector()
// we just call selector.resultFunc()
assert(myComposedSelector.resultFunc(1, 2, 3), true)
assert(myComposedSelector.resultFunc(2, 2, 1), false)
})Expected behavior:
It should be possible to test the projector function independent from the selectors it is composed of.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels