Commit 72b76d0
committed
Testing: getting repos - mocking GitHub with nock
Simulate a case where a user Strider Tester is registered
with github and has admin access to TWO repositories
one which belongs to him (stridertester/proj1) and one that
belongs to a team Strider Testers Union (stridertestersunion/union-proj-1)
getRepos should return an array containing the two repositories.
we are using actual responses received from github.com - as recorded
and mocked by nock to simulate.
This test was failing and we were getting three repositories.
This is because when getting the repos for the user, we also get
all the repos that he has access to from the teams of which he is a
member.
Also this was from the fix I intended to check in for
Strider-CD/strider#846
xdissent has already checked in the fix,
I have changed the comment to explain why a de-dupe is really needed.1 parent 8fffbbc commit 72b76d0
File tree
4 files changed
+390
-6
lines changed- lib
- test
- mocks
4 files changed
+390
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
420 | 420 | | |
421 | 421 | | |
422 | 422 | | |
423 | | - | |
| 423 | + | |
424 | 424 | | |
425 | 425 | | |
426 | 426 | | |
| |||
458 | 458 | | |
459 | 459 | | |
460 | 460 | | |
461 | | - | |
| 461 | + | |
| 462 | + | |
462 | 463 | | |
463 | 464 | | |
464 | 465 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
39 | 38 | | |
40 | | - | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
41 | 42 | | |
42 | 43 | | |
43 | 44 | | |
| |||
0 commit comments