Finish tests
This commit is contained in:
@@ -589,7 +589,7 @@ export class CodeQLCliServer implements Disposable {
|
||||
const pipeline = chain([
|
||||
fs.createReadStream(interpretedResultsPath),
|
||||
p,
|
||||
pick({filter: 'runs.0.results'}),
|
||||
pick({filter: 'runs.0.results'})
|
||||
]);
|
||||
|
||||
// Creates JavaScript objects from the token stream
|
||||
@@ -597,8 +597,11 @@ export class CodeQLCliServer implements Disposable {
|
||||
|
||||
// Returns a constructed Log object with the results or an empty array if no results were found.
|
||||
// If the parser fails for any reason, it will reject the promise.
|
||||
return await new Promise((resolve) => {
|
||||
|
||||
return await new Promise((resolve, reject) => {
|
||||
pipeline.on('error', (error) => {
|
||||
reject(error);
|
||||
});
|
||||
|
||||
asm.on('done', (asm) => {
|
||||
|
||||
const log : sarif.Log = {
|
||||
|
||||
@@ -6,7 +6,9 @@ import { CodeQLCliServer } from '../../cli';
|
||||
chai.use(chaiAsPromised);
|
||||
const expect = chai.expect;
|
||||
|
||||
describe.only('cliServerTests', () => {
|
||||
describe.only('cliServerTests', function() {
|
||||
this.timeout(10000);
|
||||
|
||||
it('should parse a valid SARIF file', async () => {
|
||||
const result = await CodeQLCliServer.parseSarif(__dirname + '/data/sarif/validSarif.sarif');
|
||||
expect(result.runs.length).to.eq(1);
|
||||
|
||||
@@ -29,7 +29,6 @@
|
||||
}
|
||||
],
|
||||
"results": []
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
{
|
||||
"version": "2.1.0",
|
||||
"$schema": "http://json.schemastore.org/sarif-2.1.0-rtm.4",
|
||||
"runs": [
|
||||
{
|
||||
"tool": {
|
||||
"driver": {
|
||||
"name": "ESLint",
|
||||
"informationUri": "https://eslint.org",
|
||||
"rules": [
|
||||
{
|
||||
"id": "no-unused-vars",
|
||||
"shortDescription": {
|
||||
"text": "disallow unused variables"
|
||||
},
|
||||
"helpUri": "https://eslint.org/docs/rules/no-unused-vars",
|
||||
"properties": {
|
||||
"category": "Variables"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"artifacts": [
|
||||
{
|
||||
"location": {
|
||||
"uri": "file:///C:/dev/sarif/sarif-tutorials/samples/Introduction/simple-example.js"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user