Skip to content

Commit

Permalink
Other: add testing docs
Browse files Browse the repository at this point in the history
  • Loading branch information
randy3k committed Nov 6, 2016
1 parent 5e705e8 commit ca207dd
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
5 changes: 5 additions & 0 deletions docs/README.md
Expand Up @@ -159,3 +159,8 @@ For more information see [custom commands documentation](custom.md)
- [flow: feature/release/hotfix publish](flow.md#flow-featurereleasehotfix-publish)
- [flow: feature/release track](flow.md#flow-featurerelease-track)
- [flow: feature pull](flow.md#flow-feature-pull)


## Package Testing

Check the implementation details of the [tests](testing.md).
32 changes: 32 additions & 0 deletions docs/testing.md
@@ -0,0 +1,32 @@
# Package Testing

We try to cover the most crucial functionality with unit tests using
[UnitTesting](https://github.com/randy3k/UnitTesting). To run the tests
locally, you should install UnitTesting via Package Control.

## Run the test specs locally

First you need to [clone](https://github.com/divmain/GitSavvy#less-simple) GitSavvy repo from source.
Open the directory `GitSavvy` and simply run the command `UnitTesting: Test Current Project`

## Some details about DeferrableTestCase

[DeferrableTestCase][1] is used to write the test cases. They are executed by
the [DeferringTextTestRunner][2] 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][3] 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][4] the
generator after `x` ms.

- Otherwise, the `yield` statement will always wait for 10 ms.

[1]: https://github.com/randy3k/UnitTesting/blob/dc810ee334bb031710b859478faaf50293880995/unittesting/core/st3/runner.py#L49
[1]: https://github.com/randy3k/UnitTesting/blob/dc810ee334bb031710b859478faaf50293880995/unittesting/core/st3/runner.py#L7
[2]: https://github.com/randy3k/UnitTesting/blob/dc810ee334bb031710b859478faaf50293880995/unittesting/core/st3/runner.py#L49
[3]: https://github.com/randy3k/UnitTesting/blob/dc810ee334bb031710b859478faaf50293880995/unittesting/core/st3/runner.py#L57

0 comments on commit ca207dd

Please sign in to comment.