File tree Expand file tree Collapse file tree
vscode-tests/no-workspace Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -589,16 +589,19 @@ export class CodeQLCliServer implements Disposable {
589589 const pipeline = chain ( [
590590 fs . createReadStream ( interpretedResultsPath ) ,
591591 p ,
592- pick ( { filter : 'runs.0.results' } ) ,
592+ pick ( { filter : 'runs.0.results' } )
593593 ] ) ;
594594
595595 // Creates JavaScript objects from the token stream
596596 const asm = Assembler . connectTo ( pipeline ) ;
597597
598598 // Returns a constructed Log object with the results or an empty array if no results were found.
599599 // If the parser fails for any reason, it will reject the promise.
600- return await new Promise ( ( resolve ) => {
601-
600+ return await new Promise ( ( resolve , reject ) => {
601+ pipeline . on ( 'error' , ( error ) => {
602+ reject ( error ) ;
603+ } ) ;
604+
602605 asm . on ( 'done' , ( asm ) => {
603606
604607 const log : sarif . Log = {
Original file line number Diff line number Diff line change @@ -6,7 +6,9 @@ import { CodeQLCliServer } from '../../cli';
66chai . use ( chaiAsPromised ) ;
77const expect = chai . expect ;
88
9- describe . only ( 'cliServerTests' , ( ) => {
9+ describe . only ( 'cliServerTests' , function ( ) {
10+ this . timeout ( 10000 ) ;
11+
1012 it ( 'should parse a valid SARIF file' , async ( ) => {
1113 const result = await CodeQLCliServer . parseSarif ( __dirname + '/data/sarif/validSarif.sarif' ) ;
1214 expect ( result . runs . length ) . to . eq ( 1 ) ;
Original file line number Diff line number Diff line change 2929 }
3030 ],
3131 "results" : []
32- ]
3332 }
3433 ]
3534}
Original file line number Diff line number Diff line change 1+ {
2+ "version" : " 2.1.0" ,
3+ "$schema" : " http://json.schemastore.org/sarif-2.1.0-rtm.4" ,
4+ "runs" : [
5+ {
6+ "tool" : {
7+ "driver" : {
8+ "name" : " ESLint" ,
9+ "informationUri" : " https://eslint.org" ,
10+ "rules" : [
11+ {
12+ "id" : " no-unused-vars" ,
13+ "shortDescription" : {
14+ "text" : " disallow unused variables"
15+ },
16+ "helpUri" : " https://eslint.org/docs/rules/no-unused-vars" ,
17+ "properties" : {
18+ "category" : " Variables"
19+ }
20+ }
21+ ]
22+ }
23+ },
24+ "artifacts" : [
25+ {
26+ "location" : {
27+ "uri" : " file:///C:/dev/sarif/sarif-tutorials/samples/Introduction/simple-example.js"
28+ }
29+ }
30+ ]
31+ }
32+ ]
33+ }
You can’t perform that action at this time.
0 commit comments