Added more test cases which common js libraries uses .pipe()

This commit is contained in:
Napalys Klicius
2025-05-23 12:30:49 +02:00
parent b10a9481f3
commit 15ff7cb41a
5 changed files with 29 additions and 1 deletions

View File

@@ -0,0 +1,3 @@
import { type } from 'arktype';
type.string.pipe(Number) // $SPURIOUS:Alert

View File

@@ -0,0 +1,11 @@
const execa = require('execa');
(async () => {
const first = execa('node', ['empty.js']);
const second = execa('node', ['stdin.js']);
first.stdout.pipe(second.stdin); // $SPURIOUS:Alert
const {stdout} = await second;
console.log(stdout);
})();

View File

@@ -0,0 +1,8 @@
const highland = require('highland');
const fs = require('fs');
highland(fs.createReadStream('input.txt'))
.map(line => {
if (line.length === 0) throw new Error('Empty line');
return line;
}).pipe(fs.createWriteStream('output.txt')); // $SPURIOUS:Alert

View File

@@ -1,7 +1,7 @@
import * as rx from 'rxjs';
import * as ops from 'rxjs/operators';
import { TestScheduler } from 'rxjs/testing';
import { pluck } from "rxjs/operators/pluck";
const { of, from } = rx;
const { map, filter } = ops;
@@ -15,4 +15,6 @@ function f(){
const source = x('', {o: [a, b, c]});
z(source.pipe(null)).toBe(expected,y,);
});
z.option$.pipe(pluck("x")) // $SPURIOUS:Alert
}

View File

@@ -1,3 +1,7 @@
| arktype.js:3:1:3:24 | type.st ... Number) | Stream pipe without error handling on the source stream. Errors won't propagate downstream and may be silently dropped. |
| execa.js:7:3:7:33 | first.s ... .stdin) | Stream pipe without error handling on the source stream. Errors won't propagate downstream and may be silently dropped. |
| highland.js:4:1:8:45 | highlan ... .txt')) | Stream pipe without error handling on the source stream. Errors won't propagate downstream and may be silently dropped. |
| rxjsStreams.js:19:3:19:28 | z.optio ... k("x")) | Stream pipe without error handling on the source stream. Errors won't propagate downstream and may be silently dropped. |
| test.js:4:5:4:28 | stream. ... nation) | Stream pipe without error handling on the source stream. Errors won't propagate downstream and may be silently dropped. |
| test.js:19:5:19:17 | s2.pipe(dest) | Stream pipe without error handling on the source stream. Errors won't propagate downstream and may be silently dropped. |
| test.js:45:5:45:30 | stream2 ... ation2) | Stream pipe without error handling on the source stream. Errors won't propagate downstream and may be silently dropped. |