Skip to content

Commit da63b99

Browse files
authored
Update mock GitHub API request models to support failures (#1644)
1 parent c325a72 commit da63b99

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

extensions/ql-vscode/src/mocks/gh-api-request.ts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,17 @@ export enum RequestKind {
1212
GetVariantAnalysisRepoResult = 'getVariantAnalysisRepoResult',
1313
}
1414

15+
export interface BasicErorResponse {
16+
message: string;
17+
}
18+
1519
export interface GetRepoRequest {
1620
request: {
1721
kind: RequestKind.GetRepo
1822
},
1923
response: {
2024
status: number,
21-
body: Repository
25+
body: Repository | BasicErorResponse | undefined
2226
}
2327
}
2428

@@ -28,7 +32,7 @@ export interface SubmitVariantAnalysisRequest {
2832
},
2933
response: {
3034
status: number,
31-
body: VariantAnalysis
35+
body?: VariantAnalysis | BasicErorResponse
3236
}
3337
}
3438

@@ -38,7 +42,7 @@ export interface GetVariantAnalysisRequest {
3842
},
3943
response: {
4044
status: number,
41-
body: VariantAnalysis
45+
body?: VariantAnalysis | BasicErorResponse
4246
}
4347
}
4448

@@ -49,7 +53,7 @@ export interface GetVariantAnalysisRepoRequest {
4953
},
5054
response: {
5155
status: number,
52-
body: VariantAnalysisRepoTask
56+
body?: VariantAnalysisRepoTask | BasicErorResponse
5357
}
5458
}
5559

@@ -60,7 +64,7 @@ export interface GetVariantAnalysisRepoResultRequest {
6064
},
6165
response: {
6266
status: number,
63-
body: ArrayBuffer
67+
body?: ArrayBuffer
6468
}
6569
}
6670

0 commit comments

Comments
 (0)