josepot / rereducer

Create declarative redux reducers without boilerplate.
MIT License
13 stars 1 forks source link

V3/improve tests #28

Closed josepot closed 6 years ago

josepot commented 6 years ago

There is still a lot of room for improvement, but now we've got 100% of test coverage, which I think it's pretty good.

Also, while I was making some of these tests I noticed a couple of things that had to be improved (1, 2). Which is noice!

Well, there is just 1 branch that I have not been able to test (this one) and I'm not going to go all nuts trying to get it tested 😄

voliva commented 6 years ago

Ah yes, that's perfect :+1:

El sáb., 20 oct. 2018 a las 20:49, Josep M Sobrepere (< notifications@github.com>) escribió:

@josepot commented on this pull request.

In test/createReducer.spec.js https://github.com/josepot/rereducer/pull/28#discussion_r226836234:

@@ -0,0 +1,33 @@ +import { createReducer, fromAction, getState } from '../src' + +describe('createReducer', () => {

  • const dependencies = ['foo', 'bar', 'baz'].map(fromAction).concat(getState)
  • const state = 'test'
  • const [foo, bar, baz] = ['fooVal', 'barVal', 'bazVal']
  • it(Accepts a list of branching functions and converging function and returns a new function. When invoked, this new function is applied to some arguments, each branching function is applied to those same arguments. The results of each branching function are passed as arguments to the converging function to produce the return value., () => {

Ok, what about this? ⬇️ Suggested change

  • it(Accepts a list of branching functions and converging function and returns a new function. When invoked, this new function is applied to some arguments, each branching function is applied to those same arguments. The results of each branching function are passed as arguments to the converging function to produce the return value., () => {
  • it(receives 2 parameters: an Array of dependency functions and a compute function. It returns a function that invokes the compute function using the results of the dependencies as the arguments, () => {

— You are receiving this because your review was requested. Reply to this email directly, view it on GitHub https://github.com/josepot/rereducer/pull/28#discussion_r226836234, or mute the thread https://github.com/notifications/unsubscribe-auth/AFHe77MnhUuf81EBoEAz1e7jCucioAmRks5um3BLgaJpZM4XbUF1 .