22
33import { IntegrationTestSetup , sleep } from "../test/IntegrationTestSetup" ;
44import * as assert from "node:assert" ;
5- import { Repos } from "./Repos" ;
6- import { ListReposResponse , RepoInfo , ReposService } from "../apis/repos" ;
5+ import { Repo } from "./Repos" ;
6+ import { RepoInfo , ReposService } from "../apis/repos" ;
77import { randomUUID } from "node:crypto" ;
88import { WorkspaceService } from "../apis/workspace" ;
9- import path from "node:path" ;
109
1110describe ( __filename , function ( ) {
1211 let integSetup : IntegrationTestSetup ;
@@ -48,30 +47,27 @@ describe(__filename, function () {
4847 } ) ;
4948
5049 it ( "should list repos by prefix" , async ( ) => {
51- let repos = new Repos ( integSetup . client ) ;
52- let response = await repos . getRepos ( {
50+ let response = await Repo . list ( integSetup . client , {
5351 path_prefix : repoDir ,
5452 } ) ;
55- assert . ok ( response . repos ! . length > 0 ) ;
53+ assert . ok ( response . length > 0 ) ;
5654 } ) ;
5755
5856 // skip test as it takes too long to run
5957 it . skip ( "should list all repos" , async ( ) => {
60- let repos = new Repos ( integSetup . client ) ;
61- let response = await repos . getRepos ( { } ) ;
58+ let response = await Repo . list ( integSetup . client , { } ) ;
6259
63- assert . notEqual ( response . repos , undefined ) ;
64- assert . ok ( response . repos ! . length > 0 ) ;
60+ assert . notEqual ( response , undefined ) ;
61+ assert . ok ( response . length > 0 ) ;
6562 } ) ;
6663
6764 it ( "should cancel listing repos" , async ( ) => {
68- let repos = new Repos ( integSetup . client ) ;
69-
7065 let token = {
7166 isCancellationRequested : false ,
7267 } ;
7368
74- let response = repos . getRepos (
69+ let response = Repo . list (
70+ integSetup . client ,
7571 {
7672 path_prefix : repoDir ,
7773 } ,
@@ -85,7 +81,7 @@ describe(__filename, function () {
8581 const start = Date . now ( ) ;
8682 await response ;
8783 assert . ok ( Date . now ( ) - start < 600 ) ;
88- assert . notEqual ( ( await response ) . repos , undefined ) ;
89- assert . ok ( ( await response ) . repos ! . length > 0 ) ;
84+ assert . notEqual ( await response , undefined ) ;
85+ assert . ok ( ( await response ) . length > 0 ) ;
9086 } ) ;
9187} ) ;
0 commit comments