File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change 22
33const { Octokit } = require ( '@octokit/rest' ) ;
44
5+ const Constants = require ( '../constants' ) ;
6+
57exports . create = ( ) => {
68
7- const octokit = new Octokit ( ) ;
9+ const octokit = new Octokit ( {
10+ userAgent : Constants . userAgent
11+ } ) ;
812
913 // @todo : onRateLimit
1014 // @todo : auth
11- // @todo : user agent
1215
1316 return octokit ;
1417} ;
Original file line number Diff line number Diff line change @@ -594,7 +594,11 @@ describe('detect-node-support', () => {
594594 fixture . stubs . listRemote
595595 . returns ( '9cef39d21ad229dea4b10295f55b0d9a83800b23\tHEAD\n' ) ;
596596
597- Nock ( 'https://api.github.com' )
597+ Nock ( 'https://api.github.com' , {
598+ reqheaders : {
599+ 'user-agent' : / d e t e c t - n o d e - s u p p o r t \/ .* \( h t t p s : \/ \/ g i t h u b .c o m \/ p k g j s \/ d e t e c t - n o d e - s u p p o r t # r e a d m e \) /
600+ }
601+ } )
598602 . get ( '/repos/pkgjs/detect-node-support/contents/package.json' )
599603 . reply ( 200 , {
600604 content : Fs . readFileSync ( Path . join ( __dirname , '..' , 'package.json' ) ) . toString ( 'base64' )
You can’t perform that action at this time.
0 commit comments