Automated tests (unit and e2e)
Narigo opened this issue · 3 comments
Narigo commented
Right now, testing relies on me doing manual tests. It would be a lot better to have automated tests verified by Travis / GitHub Actions or similar.
There should be two kinds of tests:
- E2E tests, running the CLI and testing various options against a snapshot of results
- Unit tests, testing the diffing algorithm and the results
Narigo commented
I've added a few e2e test in run-tests.sh
to make it a bit faster for me to check some properties. It doesn't do snapshot tests but I think this is good enough for now.
Unit tests were added for the StringStack that I've added to keep track of the used paths. The diffing algorithm is still untested - @sseemayer do you still want to have a look into it?
Narigo commented
The e2e test should include flags for user input as well. Piping a file as stdin should work but it looks like the output is not starting on a new line then.