Let's look at some example sagas to see how redux-saga-test-plan makes it easy to test them. It also runs your saga with redux-saga's runtime so that you can write integration tests, or you can use redux-saga-test-plan's built-in effect mocking to write unit tests too. It offers very useful helper methods, called effects. It offers a declarative, chainable API for testing that your saga yields certain effects without worrying about other effects or the order effects were yielded. Redux Saga is an excellent framework for managing the various changes and side effects that will occur in our applications. Redux-saga-test-plan removes the headache of manually testing saga generator functions that couple your tests to their implementations. If you're unfamiliar with redux-saga, check out the redux-saga interview with creator Yassine Elouafi. Redux-saga-test-plan is a library for easily testing redux-saga. How would you describe redux-saga-test-plan to someone who has never heard of it? # The book is over halfway complete and should be available sometime in Spring 2018. In this object, we will be passing dispatch callback that stores all dispatched actions in the array, and finally, the saga that needs to be tested as a second argument. The first argument of this function should be an object with options on how to run a saga. In fact, I'm currently writing a book on Elm with The Pragmatic Programmers called Programming Elm: Build Safe and Maintainable Front-End Applications. To test the saga, we will use the runSaga function from the redux-saga module. I'm a huge fan of functional programming and Elm. I've created a few open source projects that work well with the React and Redux ecosystem such as revalidate, redux-saga-router, and, the topic of this interview, redux-saga-test-plan. I've been doing front-end development for almost ten years now and enjoy the paradigms that React and Redux helped introduce to the front-end world. Our mission is to improve how the world builds software. We believe that software is broken, and we're here to fix it. I'm a software engineer and consultant with Test Double. redux-saga-test-plan by Jeremy Fairbank was designed precisely for this purpose. Redux Saga is famous for being easy to test but what if it could be even more comfortable. Ive been a redux-saga user for a year now, and I still remember when I was introduced to the library.
0 Comments
Leave a Reply. |