@@ -13,9 +13,7 @@ import { ColumnValue } from '../../pure/bqrs-cli-types';
1313import { FindDistributionResultKind } from '../../distribution' ;
1414
1515
16- declare module 'url' {
17- export function pathToFileURL ( urlStr : string ) : Url ;
18- }
16+ const baseDir = path . join ( __dirname , '../../../test/data' ) ;
1917
2018const tmpDir = tmp . dirSync ( { prefix : 'query_test_' , keep : false , unsafeCleanup : true } ) ;
2119
@@ -61,21 +59,27 @@ type QueryTestCase = {
6159// Test cases: queries to run and their expected results.
6260const queryTestCases : QueryTestCase [ ] = [
6361 {
64- queryPath : path . join ( __dirname , '../data/ query.ql' ) ,
62+ queryPath : path . join ( baseDir , 'query.ql' ) ,
6563 expectedResultSets : {
6664 '#select' : [ [ 42 , 3.14159 , 'hello world' , true ] ]
6765 }
6866 } ,
6967 {
70- queryPath : path . join ( __dirname , '../data/multiple-result-sets.ql' ) ,
68+ queryPath : path . join ( baseDir , 'compute-default-strings.ql' ) ,
69+ expectedResultSets : {
70+ '#select' : [ [ { label : '(no string representation)' } ] ]
71+ }
72+ } ,
73+ {
74+ queryPath : path . join ( baseDir , 'multiple-result-sets.ql' ) ,
7175 expectedResultSets : {
7276 'edges' : [ [ 1 , 2 ] , [ 2 , 3 ] ] ,
7377 '#select' : [ [ 's' ] ]
7478 }
7579 }
7680] ;
7781
78- describe ( 'using the query server' , function ( ) {
82+ describe . only ( 'using the query server' , function ( ) {
7983 before ( function ( ) {
8084 if ( process . env [ 'CODEQL_PATH' ] === undefined ) {
8185 console . log ( 'The environment variable CODEQL_PATH is not set. The query server tests, which require the CodeQL CLI, will be skipped.' ) ;
@@ -92,12 +96,8 @@ describe('using the query server', function() {
9296 let cliServer : cli . CodeQLCliServer ;
9397 const queryServerStarted = new Checkpoint < void > ( ) ;
9498 after ( ( ) => {
95- if ( qs ) {
96- qs . dispose ( ) ;
97- }
98- if ( cliServer ) {
99- cliServer . dispose ( ) ;
100- }
99+ qs ?. dispose ( ) ;
100+ cliServer ?. dispose ( ) ;
101101 } ) ;
102102
103103 it ( 'should be able to start the query server' , async function ( ) {
@@ -156,7 +156,7 @@ describe('using the query server', function() {
156156 try {
157157 const qlProgram : messages . QlProgram = {
158158 libraryPath : [ ] ,
159- dbschemePath : path . join ( __dirname , '../data/ test.dbscheme' ) ,
159+ dbschemePath : path . join ( baseDir , 'test.dbscheme' ) ,
160160 queryPath : queryTestCase . queryPath
161161 } ;
162162 const params : messages . CompileQueryParams = {
0 commit comments