File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed
test/vscode-tests/no-workspace Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,12 @@ export async function readJsonlFile<T>(
2424 return new Promise ( ( resolve , reject ) => {
2525 const stream = createReadStream ( path , { encoding : "utf8" } ) ;
2626 let buffer = "" ;
27- stream . on ( "data" , async ( chunk : string ) => {
27+ stream . on ( "data" , async ( chunk : string | Buffer ) => {
28+ if ( typeof chunk !== "string" ) {
29+ // This should never happen because we specify the encoding as "utf8".
30+ throw new Error ( "Invalid chunk" ) ;
31+ }
32+
2833 const parts = ( buffer + chunk ) . split ( doubleLineBreakRegexp ) ;
2934 buffer = parts . pop ( ) ! ;
3035 if ( parts . length > 0 ) {
Original file line number Diff line number Diff line change @@ -291,7 +291,7 @@ describe("query-results", () => {
291291 } ) ;
292292
293293 const finished = new Promise ( ( res , rej ) => {
294- validSarifStream . addListener ( "close" , res ) ;
294+ validSarifStream . addListener ( "close" , ( ) => res ( undefined ) ) ;
295295 validSarifStream . addListener ( "error" , rej ) ;
296296 } ) ;
297297
@@ -357,7 +357,7 @@ describe("query-results", () => {
357357 } ) ;
358358
359359 const finished = new Promise ( ( res , rej ) => {
360- invalidSarifStream . addListener ( "close" , res ) ;
360+ invalidSarifStream . addListener ( "close" , ( ) => res ( undefined ) ) ;
361361 invalidSarifStream . addListener ( "error" , rej ) ;
362362 } ) ;
363363
You can’t perform that action at this time.
0 commit comments