-
Notifications
You must be signed in to change notification settings - Fork 87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tests refactoring #66
Conversation
…ic, not test data should be tested
…no need to test existence of test data
So the |
We could probably abstract reading the test files into a function that just matches the file contents against a path, something like We're not actually writing output, just getting the Vinyl file object from the stream, so that's fine. |
Hi Larry, thanks for feedback! In fact I hadn't had a plan to refactor tests, but started writing code that consistently solves #65 problem and found that I need to improve tests readability in order to complete my PR with written tests for the new code. |
Yeah, this is good. We could spend all day making tests look simpler, but this is a great improvement as-is. Can you do me a favor and double check that there are no false positives as a result of this refactor? Simply invert every expect and make sure they all fail. Sometimes the asynchronous nature of a test gets overlooked in these kinds of refactors, and it ends up passing with flying colors when it ought to fail. If it passes that little audit, then we're good to merge. |
It's all arranged! |
Hi Larry. I've just checked if every test fails with inverted assertion and this is true. I've also become convinced of the test verifying |
Let's merge it! |
A bunch of changes:
beforeEach
blocksstream
with abuffer
in a test case nameQuestions
Seems like reading-writing test files in every test case is rather useless and, even worse, makes tests code too complicated. Ideally, each test case should consist only of one check, but I don't know yet how to achieve such simplicity. Maybe you have any thoughts?
I also wonder why are the file parameters such as
cwd
andbase
needed. Once I remove them nothing happens, but I don't sure if this is a regression-safe change.