File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed
extensions/ql-vscode/src/vscode-tests/cli-integration Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change 1+ import javascript
2+
13predicate edges ( int i , int j ) {
24 i = 1 and j = 2 or i = 2 and j = 3
35}
Original file line number Diff line number Diff line change 11import { expect } from 'chai' ;
2- import { extensions } from 'vscode' ;
2+ import { extensions , Uri } from 'vscode' ;
3+ import * as path from 'path' ;
34import { SemVer } from 'semver' ;
45
5- import { CodeQLCliServer } from '../../cli' ;
6+ import { CodeQLCliServer , QueryInfoByLanguage } from '../../cli' ;
67import { CodeQLExtensionInterface } from '../../extension' ;
78import { skipIfNoCodeQL } from '../ensureCli' ;
89import { getOnDiskWorkspaceFolders } from '../../helpers' ;
@@ -60,4 +61,11 @@ describe('Use cli', function() {
6061 expect ( languages ) . to . have . property ( expectedLanguage ) . that . is . not . undefined ;
6162 }
6263 } ) ;
64+
65+ it ( 'should resolve query by language' , async function ( ) {
66+ skipIfNoCodeQL ( this ) ;
67+ const queryPath = path . join ( __dirname , 'data' , 'simple-query.ql' ) ;
68+ const queryInfo : QueryInfoByLanguage = await cli . resolveQueryByLanguage ( getOnDiskWorkspaceFolders ( ) , Uri . file ( queryPath ) ) ;
69+ expect ( ( Object . keys ( queryInfo . byLanguage ) ) [ 0 ] ) . to . eql ( 'javascript' ) ;
70+ } ) ;
6371} ) ;
You can’t perform that action at this time.
0 commit comments