forked from github/vscode-codeql
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcli.test.ts
More file actions
23 lines (18 loc) · 786 Bytes
/
cli.test.ts
File metadata and controls
23 lines (18 loc) · 786 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import * as chai from 'chai';
import * as chaiAsPromised from 'chai-as-promised';
import { CodeQLCliServer } from '../../cli';
chai.use(chaiAsPromised);
const expect = chai.expect;
describe.only('cliServerTests', function() {
it('should parse a valid SARIF file', async () => {
const result = await CodeQLCliServer.parseSarif(__dirname + '/data/sarif/validSarif.sarif');
expect(result.version).to.exist;
expect(result.runs).to.exist;
expect(result.runs[0].tool).to.exist;
expect(result.runs[0].tool.driver).to.exist;
});
it('should return an empty array if there are no results', async () => {
const result = await CodeQLCliServer.parseSarif(__dirname + '/data/sarif/emptyResultsSarif.sarif');
expect(result.runs[0].results).to.be.empty;
});
});