nytimes / redux-taxi

🚕 Component-driven asynchronous SSR in isomorphic Redux apps
Other
71 stars 8 forks source link

Move to Jest Expect #6

Closed frytyler closed 6 years ago

frytyler commented 6 years ago

This PR removes chai package which was primarily using the assert style tests in favour of using standard jest except assertions.

All tests are passing as they were before, in the process of converting I refactored the tests to read a bit better. There were a few tests in PromiseMiddleware.test.js that were throwing unhandled promise rejection warnings, these have all been resolved through the reorganization of the tests.

I opted to use sinon.spy's to assist in the readability of the tests.

This will complete #3

Closes #3

frytyler commented 6 years ago

@tizmagik let me know if you need any changes on this

frytyler commented 6 years ago

@tizmagik Jest mocks for the win. They actually reduced a few areas down a bit which was nice. I also fixed the skipped test in registerAsyncActions. I split it into 3 tests and asserted in the catch, Maybe have a quick look to make sure they are doing what you want as I didn't have thing to compare to from before.