-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Testing: getting repos - mocking GitHub with nock #52
Conversation
8a4ad9b
to
0e65247
Compare
// stridertester/proj1 | ||
|
||
//This file sets up mock responses as received from github for each request fired | ||
//during the get repositories operation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tip: For comment blocks this big (> 2 lines) /**/
should be used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok! Will fix.
On Friday, August 21, 2015, Ilya Radchenko notifications@github.com wrote:
In test/mocks/setup_nock_repos.js
#52 (comment)
:@@ -0,0 +1,325 @@
+var nock = require('nock');
+
+//Set up the mocks for getting a list of repositories for the stridertest user
+//The stridertest user is an admin of two organizations
+// stridertestersunion and
+// stridertesters1
+//and has two repositories to which he has admin access
+// stridertestersunion/union-proj-1
+// stridertester/proj1
+
+//This file sets up mock responses as received from github for each request fired
+//during the get repositories operationTip: For comment blocks this big (> 2 lines) /**/ should be used.
—
Reply to this email directly or view it on GitHub
https://github.com/Strider-CD/strider-github/pull/52/files#r37629025.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
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.
Testing: getting repos - mocking GitHub with nock
Anyone know how to access this github user? Need to login to update the access token. |
Hi Ilya!
Found it. Will mail it to you.
Thanks!
warm regards,
Aalhad
…On Fri, Aug 10, 2018 at 9:21 AM Ilya Radchenko ***@***.***> wrote:
Anyone know how to access this github user? Need to login to update the
access token.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#52 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAHK9edDJ9kfiH8ZvooGNWZXnTn3vcM6ks5uPQNVgaJpZM4FvmJf>
.
|
Got it, thanks! |
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.