@@ -10,7 +10,7 @@ import { CancellationTokenSource } from 'vscode-jsonrpc';
10
10
import * as messages from '../../src/messages' ;
11
11
import * as qsClient from '../../src/queryserver-client' ;
12
12
import * as cli from '../../src/cli' ;
13
- import { ProgressReporter } from '../../src/logging' ;
13
+ import { ProgressReporter , Logger } from '../../src/logging' ;
14
14
15
15
16
16
declare module "url" {
@@ -75,8 +75,8 @@ const queryTestCases: QueryTestCase[] = [
75
75
}
76
76
] ;
77
77
78
- describe ( 'using the query server' , function ( ) {
79
- before ( function ( ) {
78
+ describe ( 'using the query server' , function ( ) {
79
+ before ( function ( ) {
80
80
if ( process . env [ "CODEQL_PATH" ] === undefined ) {
81
81
console . log ( 'The environment variable CODEQL_PATH is not set. The query server tests, which require the CodeQL CLI, will be skipped.' ) ;
82
82
this . skip ( ) ;
@@ -100,13 +100,14 @@ describe('using the query server', function () {
100
100
}
101
101
} ) ;
102
102
103
- it ( 'should be able to start the query server' , async function ( ) {
103
+ it ( 'should be able to start the query server' , async function ( ) {
104
104
const consoleProgressReporter : ProgressReporter = {
105
- report : ( v : { message : string } ) => console . log ( `progress reporter says ${ v . message } ` )
105
+ report : ( v : { message : string } ) => console . log ( `progress reporter says ${ v . message } ` )
106
106
} ;
107
- const logger = {
107
+ const logger : Logger = {
108
108
log : ( s : string ) => console . log ( 'logger says' , s ) ,
109
- logWithoutTrailingNewline : ( s : string ) => console . log ( 'logger says' , s )
109
+ logWithoutTrailingNewline : ( s : string ) => console . log ( 'logger says' , s ) ,
110
+ show : ( ) => { } ,
110
111
} ;
111
112
cliServer = new cli . CodeQLCliServer ( {
112
113
async getCodeQlPathWithoutVersionCheck ( ) : Promise < string | undefined > {
@@ -137,7 +138,7 @@ describe('using the query server', function () {
137
138
const evaluationSucceeded = new Checkpoint < void > ( ) ;
138
139
const parsedResults = new Checkpoint < void > ( ) ;
139
140
140
- it ( `should be able to compile query ${ queryName } ` , async function ( ) {
141
+ it ( `should be able to compile query ${ queryName } ` , async function ( ) {
141
142
await queryServerStarted . done ( ) ;
142
143
expect ( fs . existsSync ( queryTestCase . queryPath ) ) . to . be . true ;
143
144
try {
@@ -169,7 +170,7 @@ describe('using the query server', function () {
169
170
}
170
171
} ) ;
171
172
172
- it ( `should be able to run query ${ queryName } ` , async function ( ) {
173
+ it ( `should be able to run query ${ queryName } ` , async function ( ) {
173
174
try {
174
175
await compilationSucceeded . done ( ) ;
175
176
const callbackId = qs . registerCallback ( _res => {
@@ -201,7 +202,7 @@ describe('using the query server', function () {
201
202
} ) ;
202
203
203
204
const actualResultSets : ResultSets = { } ;
204
- it ( `should be able to parse results of query ${ queryName } ` , async function ( ) {
205
+ it ( `should be able to parse results of query ${ queryName } ` , async function ( ) {
205
206
let fileReader : FileReader | undefined ;
206
207
try {
207
208
await evaluationSucceeded . done ( ) ;
@@ -222,7 +223,7 @@ describe('using the query server', function () {
222
223
}
223
224
} ) ;
224
225
225
- it ( `should have correct results for query ${ queryName } ` , async function ( ) {
226
+ it ( `should have correct results for query ${ queryName } ` , async function ( ) {
226
227
await parsedResults . done ( ) ;
227
228
expect ( actualResultSets ! ) . not . to . be . empty ;
228
229
expect ( Object . keys ( actualResultSets ! ) . sort ( ) ) . to . eql ( Object . keys ( queryTestCase . expectedResultSets ) . sort ( ) ) ;
0 commit comments