1- import GithubRestAPI from '../rest.js' ;
1+ import API , { CodeScan } from '../rest.js' ;
22import assert from 'assert' ;
33
44describe ( 'octokit:rest module' , function ( ) {
55 this . timeout ( 0 )
66 it ( 'public access' , async ( ) => {
7- const api = new GithubRestAPI ( ) ;
7+ const api = new API ( ) ;
88 assert . ok ( await api . connect ( ) )
9- const { data} = await api . client . rest . repos . listForOrg ( {
9+ const { data} = await api . client . repos . listForOrg ( {
1010 org : "octokit" ,
1111 type : "public" ,
1212 } )
@@ -16,7 +16,7 @@ describe('octokit:rest module', function () {
1616
1717 it ( 'connect' , async ( ) => {
1818 const pat = process . env . GITHUB_TOKEN
19- const api = new GithubRestAPI ( { pat} )
19+ const api = new API ( { pat} )
2020 assert . ok ( await api . connect ( ) )
2121 const { login, type, user_view_type} = await api . me ( )
2222
@@ -25,4 +25,23 @@ describe('octokit:rest module', function () {
2525 assert . equal ( type , 'User' )
2626 assert . equal ( user_view_type , 'private' )
2727 } )
28+ } )
29+ describe ( 'codeScan' , function ( ) {
30+ this . timeout ( 0 )
31+
32+ it ( 'list for repos' , async ( ) => {
33+ const pat = process . env . GITHUB_TOKEN
34+ const api = new CodeScan ( { pat} )
35+ const org = 'davidkhala'
36+ const repo = 'ci-cd-utils'
37+ const data = await api . listForRepo ( org , repo )
38+ console . debug ( data )
39+ } )
40+ it ( 'list for org' , async ( ) => {
41+ const pat = process . env . GITHUB_TOKEN
42+ const api = new CodeScan ( { pat} )
43+ const org = 'stage4fish'
44+ const data = await api . listForOrg ( org )
45+ console . debug ( data )
46+ } )
2847} )
0 commit comments