February 2022
Intermediate to advanced
274 pages
6h 28m
English
So far we’ve utilized return values from a mocked method to make sure our application code is dealing with the return values correctly. But sometimes there is not any useful return value. In those cases, we can actually ask the mock object if it was called correctly.
The config command calls .path() and prints the return value. So we can mock the return value of .path() and and test what config prints. The count command prints the output of db.count(), so we can test that a lot like config.
But there are a bunch of other commands where we can’t test the behavior by checking the output, because there is no output. For instance, cards add some tasks -o brian.
After calling cards_cli("add some tasks -o ...
Read now
Unlock full access