File tree 4 files changed +42
-5
lines changed
vscode-tests/no-workspace
4 files changed +42
-5
lines changed Original file line number Diff line number Diff line change @@ -589,16 +589,19 @@ export class CodeQLCliServer implements Disposable {
589
589
const pipeline = chain ( [
590
590
fs . createReadStream ( interpretedResultsPath ) ,
591
591
p ,
592
- pick ( { filter : 'runs.0.results' } ) ,
592
+ pick ( { filter : 'runs.0.results' } )
593
593
] ) ;
594
594
595
595
// Creates JavaScript objects from the token stream
596
596
const asm = Assembler . connectTo ( pipeline ) ;
597
597
598
598
// Returns a constructed Log object with the results or an empty array if no results were found.
599
599
// 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
+
602
605
asm . on ( 'done' , ( asm ) => {
603
606
604
607
const log : sarif . Log = {
Original file line number Diff line number Diff line change @@ -6,7 +6,9 @@ import { CodeQLCliServer } from '../../cli';
6
6
chai . use ( chaiAsPromised ) ;
7
7
const expect = chai . expect ;
8
8
9
- describe . only ( 'cliServerTests' , ( ) => {
9
+ describe . only ( 'cliServerTests' , function ( ) {
10
+ this . timeout ( 10000 ) ;
11
+
10
12
it ( 'should parse a valid SARIF file' , async ( ) => {
11
13
const result = await CodeQLCliServer . parseSarif ( __dirname + '/data/sarif/validSarif.sarif' ) ;
12
14
expect ( result . runs . length ) . to . eq ( 1 ) ;
Original file line number Diff line number Diff line change 29
29
}
30
30
],
31
31
"results" : []
32
- ]
33
32
}
34
33
]
35
34
}
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