@@ -70,6 +70,24 @@ describe('authentication', () => {
70
70
return github . orgs . get ( { org : 'myorg' } )
71
71
} )
72
72
73
+ it ( 'oauth token with query' , ( ) => {
74
+ nock ( 'https://authentication-test-host.com' )
75
+ . get ( '/orgs/myorg/repos' )
76
+ . query ( { per_page : 1 , access_token : 'abc4567' } )
77
+ . reply ( 200 , [ ] )
78
+
79
+ const github = new GitHub ( {
80
+ host : 'authentication-test-host.com'
81
+ } )
82
+
83
+ github . authenticate ( {
84
+ type : 'oauth' ,
85
+ token : 'abc4567'
86
+ } )
87
+
88
+ return github . repos . getForOrg ( { org : 'myorg' , per_page : 1 } )
89
+ } )
90
+
73
91
it ( 'oauth key & secret' , ( ) => {
74
92
nock ( 'https://authentication-test-host.com' )
75
93
. get ( '/orgs/myorg' )
@@ -89,6 +107,25 @@ describe('authentication', () => {
89
107
return github . orgs . get ( { org : 'myorg' } )
90
108
} )
91
109
110
+ it ( 'oauth key & secret with query' , ( ) => {
111
+ nock ( 'https://authentication-test-host.com' )
112
+ . get ( '/orgs/myorg/repos' )
113
+ . query ( { per_page : 1 , client_id : 'oauthkey' , client_secret : 'oauthsecret' } )
114
+ . reply ( 200 , [ ] )
115
+
116
+ const github = new GitHub ( {
117
+ host : 'authentication-test-host.com'
118
+ } )
119
+
120
+ github . authenticate ( {
121
+ type : 'oauth' ,
122
+ key : 'oauthkey' ,
123
+ secret : 'oauthsecret'
124
+ } )
125
+
126
+ return github . repos . getForOrg ( { org : 'myorg' , per_page : 1 } )
127
+ } )
128
+
92
129
it ( 'integration' , ( ) => {
93
130
nock ( 'https://authentication-test-host.com' , {
94
131
reqheaders : {
0 commit comments