Add test for resolveQueryByLanguage
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import javascript
|
||||
|
||||
predicate edges(int i, int j) {
|
||||
i = 1 and j = 2 or i = 2 and j = 3
|
||||
}
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
import { expect } from 'chai';
|
||||
import { extensions } from 'vscode';
|
||||
import { extensions, Uri } from 'vscode';
|
||||
import * as path from 'path';
|
||||
import { SemVer } from 'semver';
|
||||
|
||||
import { CodeQLCliServer } from '../../cli';
|
||||
import { CodeQLCliServer, QueryInfoByLanguage } from '../../cli';
|
||||
import { CodeQLExtensionInterface } from '../../extension';
|
||||
import { skipIfNoCodeQL } from '../ensureCli';
|
||||
import { getOnDiskWorkspaceFolders } from '../../helpers';
|
||||
@@ -60,4 +61,11 @@ describe('Use cli', function() {
|
||||
expect(languages).to.have.property(expectedLanguage).that.is.not.undefined;
|
||||
}
|
||||
});
|
||||
|
||||
it('should resolve query by language', async function() {
|
||||
skipIfNoCodeQL(this);
|
||||
const queryPath = path.join(__dirname, 'data', 'simple-query.ql');
|
||||
const queryInfo: QueryInfoByLanguage = await cli.resolveQueryByLanguage(getOnDiskWorkspaceFolders(), Uri.file(queryPath));
|
||||
expect((Object.keys(queryInfo.byLanguage))[0]).to.eql('javascript');
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user