[Proposal] Use the testing framework assertion library for better integration
See original GitHub issueThe current behavior is unmet expectation is to throw an error with a formatted string of unmet expectations.
For small examples it is not an issue, however, when you have nested objects to assert (e.g. 2 level deep objects) or many effects to except the error message becomes very unreadable. It is hard to find what exactly didn’t match.
If we use the testing framework, for example jest
, assertion library (expect
) errors will be printed using the library’s reporter.
In my case, they will be formatted by WebStorm reporter which have a nice diff view which I missing when using redux-saga-test-plan
.
What do you think about this proposal?
Issue Analytics
- State:
- Created 4 years ago
- Reactions:5
- Comments:16
Top Results From Across the Web
What is the difference between a test runner, testing framwork ...
The assertion library is what actually runs the specs and determines whether any given condition is valid or not. Ultimately, every test is...
Read more >Exploring the landscape of Go testing frameworks
The library gocheck offers similar functionality to Testify. It's a testing framework with support for rich assertions, the definition of test ...
Read more >Golang Testing Frameworks for Every Type of Test - Speedscale
Testing frameworks offer a range of benefits. They include utilities like assertions and matchers that aren't present in the testing package.
Read more >API Testing: Approaches, Tools, and Frameworks - AltexSoft
API testing kills bugs early in the development cycle. How to test APIs, which tool to use: Postman, Rest Assured, or jMeter, why...
Read more >Comparing the best Node.js unit testing frameworks
It aims to run on any JavaScript-enabled platform and is highly flexible and compatible with a variety of other testing frameworks and libraries...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@borrascador it’s the built-in
expect
in Jest. Try to use it in https://github.com/jfairbank/redux-saga-test-plan/blob/master/src/expectSaga/expectations.js file instead ofthrow
For those who are interested. Unfortunately, I didn’t have time to make the code more organized, however, Jest integration works perfectly. I tested my previous project which had a lot of saga tests using this library.
The code is available in my forked repo on this branch https://github.com/mike1808/redux-saga-test-plan/tree/beta-jest
You can try on your projects by installing
jest-redux-saga-test-plan@4.0.0-beta.5
Few caveats:
upgrade-to-babel7
as its new versions of babel was required to use the new Jest version.Map
), so my fork might not work on Node.js < 8expectSaga
. I didn’t touch the unit testing API.If you have any question about code, feel free to write here, or, if you want to continue my work, we can set up a zoom/skype call and I’ll share all context I have.
cc @dbartholomae @vov462 @Taguhi