Skip to content

Commit 91344a7

Browse files
Fix tests that use parseResponse
1 parent 7538ad1 commit 91344a7

1 file changed

Lines changed: 15 additions & 8 deletions

File tree

extensions/ql-vscode/src/vscode-tests/no-workspace/remote-queries/run-remote-query.test.ts

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
11
import { expect } from 'chai';
22
import * as os from 'os';
33
import { parseResponse } from '../../../remote-queries/run-remote-query';
4+
import { Repository } from '../../../remote-queries/shared/repository';
45

56
describe('run-remote-query', () => {
67
describe('parseResponse', () => {
8+
const controllerRepository: Repository = {
9+
id: 123,
10+
fullName: 'org/name',
11+
private: true
12+
};
13+
714
it('should parse a successful response', () => {
8-
const result = parseResponse('org', 'name', {
15+
const result = parseResponse(controllerRepository, {
916
workflow_run_id: 123,
1017
repositories_queried: ['a/b', 'c/d'],
1118
});
@@ -20,7 +27,7 @@ describe('run-remote-query', () => {
2027
});
2128

2229
it('should parse a response with invalid repos', () => {
23-
const result = parseResponse('org', 'name', {
30+
const result = parseResponse(controllerRepository, {
2431
workflow_run_id: 123,
2532
repositories_queried: ['a/b', 'c/d'],
2633
errors: {
@@ -47,7 +54,7 @@ describe('run-remote-query', () => {
4754
});
4855

4956
it('should parse a response with repos w/o databases', () => {
50-
const result = parseResponse('org', 'name', {
57+
const result = parseResponse(controllerRepository, {
5158
workflow_run_id: 123,
5259
repositories_queried: ['a/b', 'c/d'],
5360
errors: {
@@ -75,7 +82,7 @@ describe('run-remote-query', () => {
7582
});
7683

7784
it('should parse a response with private repos', () => {
78-
const result = parseResponse('org', 'name', {
85+
const result = parseResponse(controllerRepository, {
7986
workflow_run_id: 123,
8087
repositories_queried: ['a/b', 'c/d'],
8188
errors: {
@@ -103,7 +110,7 @@ describe('run-remote-query', () => {
103110
});
104111

105112
it('should parse a response with cutoff repos and cutoff repos count', () => {
106-
const result = parseResponse('org', 'name', {
113+
const result = parseResponse(controllerRepository, {
107114
workflow_run_id: 123,
108115
repositories_queried: ['a/b', 'c/d'],
109116
errors: {
@@ -132,7 +139,7 @@ describe('run-remote-query', () => {
132139
});
133140

134141
it('should parse a response with cutoff repos count but not cutoff repos', () => {
135-
const result = parseResponse('org', 'name', {
142+
const result = parseResponse(controllerRepository, {
136143
workflow_run_id: 123,
137144
repositories_queried: ['a/b', 'c/d'],
138145
errors: {
@@ -159,7 +166,7 @@ describe('run-remote-query', () => {
159166
});
160167

161168
it('should parse a response with invalid repos and repos w/o databases', () => {
162-
const result = parseResponse('org', 'name', {
169+
const result = parseResponse(controllerRepository, {
163170
workflow_run_id: 123,
164171
repositories_queried: ['a/b', 'c/d'],
165172
errors: {
@@ -191,7 +198,7 @@ describe('run-remote-query', () => {
191198
});
192199

193200
it('should parse a response with one repo of each category, and not pluralize "repositories"', () => {
194-
const result = parseResponse('org', 'name', {
201+
const result = parseResponse(controllerRepository, {
195202
workflow_run_id: 123,
196203
repositories_queried: ['a/b'],
197204
errors: {

0 commit comments

Comments
 (0)