We try to cover the most crucial functionality with unit tests using UnitTesting. To run the tests locally, you should install UnitTesting via Package Control.
First you need to clone GitSavvy repo from source.
Open the directory GitSavvy
and simply run the command UnitTesting: Test Current Project
DeferrableTestCase is used to write the test cases. They are executed by the DeferringTextTestRunner and the runner expects not only regular test functions, but also generators. If the test function is a generator, it does the following
-
if the yielded object is a callable, the runner will evaluate the callable and check its returned value. If the result is
True
, the runner continues the generator, if not, the runner will wait until the condition is met. -
If the yielded object is an integer, say
x
, then it will continue the generator afterx
ms. -
Otherwise, the
yield
statement will always wait for 10 ms.