Added test cases where second parameter passed to pipe is a function and some popular library ones

This commit is contained in:
Napalys Klicius
2025-05-22 16:38:28 +02:00
parent ac24fdd348
commit e6ae8bbde4
4 changed files with 20 additions and 0 deletions

View File

@@ -1,5 +1,7 @@
import * as rx from 'rxjs';
import * as ops from 'rxjs/operators';
import { TestScheduler } from 'rxjs/testing';
const { of, from } = rx;
const { map, filter } = ops;
@@ -7,4 +9,10 @@ const { map, filter } = ops;
function f(){
of(1, 2, 3).pipe(map(x => x * 2));
someNonStream().pipe(map(x => x * 2));
let testScheduler = new TestScheduler();
testScheduler.run(({x, y, z}) => {
const source = x('', {o: [a, b, c]});
z(source.pipe(null)).toBe(expected,y,); // $SPURIOUS:Alert
});
}

View File

@@ -0,0 +1,5 @@
import { async } from '@strapi/utils';
const f = async () => {
const permissionsInDB = await async.pipe(strapi.db.query('x').findMany,map('y'))(); // $SPURIOUS:Alert
}

View File

@@ -1,3 +1,5 @@
| rxjsStreams.js:16:7:16:23 | source.pipe(null) | Stream pipe without error handling on the source stream. Errors won't propagate downstream and may be silently dropped. |
| strapi.js:4:35:4:84 | async.p ... p('y')) | 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. |
@@ -11,3 +13,4 @@
| test.js:143:5:143:62 | stream. ... itable) | Stream pipe without error handling on the source stream. Errors won't propagate downstream and may be silently dropped. |
| test.js:175:17:175:40 | notStre ... itable) | Stream pipe without error handling on the source stream. Errors won't propagate downstream and may be silently dropped. |
| test.js:185:5:185:32 | copyStr ... nation) | Stream pipe without error handling on the source stream. Errors won't propagate downstream and may be silently dropped. |
| test.js:216:5:216:38 | notStre ... ()=>{}) | Stream pipe without error handling on the source stream. Errors won't propagate downstream and may be silently dropped. |

View File

@@ -211,4 +211,8 @@ function test() {
const p = plumber();
getStream().pipe(p).pipe(dest).pipe(dest).pipe(dest);
}
{
const notStream = getNotAStream();
notStream.pipe(getStream(),()=>{}); // $SPURIOUS:Alert
}
}