Skip to content

Commit 2eae459

Browse files
committed
fix:
1 parent 8572fb7 commit 2eae459

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

spec/asynciterable/catcherror-spec.ts

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { jest } from '@jest/globals';
12
import { skip } from 'ix/asynciterable/operators.js';
23
import { hasNext } from '../asynciterablehelpers.js';
34
import {
@@ -42,11 +43,13 @@ test('AsyncIterable#catchError still throws', async () => {
4243
});
4344

4445
test('AsyncIterable#catchError calls return() on source iterator when stopped early', async () => {
45-
const xs1 = range(0, 2);
46+
const e1 = new Error();
47+
const er1 = throwError(e1);
48+
4649
const xs2 = range(2, 2)[Symbol.asyncIterator]();
4750
const returnSpy = jest.spyOn(xs2, 'return');
4851

49-
const res = catchError(xs1, from(xs2)).pipe(skip(2));
52+
const res = catchError(concat(range(0, 2), er1), from(xs2)).pipe(skip(2));
5053

5154
await first(res);
5255

spec/iterable/catcherror-spec.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,13 @@ test('Iterable.catchError still throws', () => {
4343
});
4444

4545
test('Iterable.catchError calls return() on source iterator when stopped early', () => {
46-
const xs1 = range(0, 2);
46+
const e1 = new Error();
47+
const er1 = throwError(e1);
48+
4749
const xs2 = range(2, 2)[Symbol.iterator]();
4850
const returnSpy = jest.spyOn(xs2, 'return');
4951

50-
const res = catchError(xs1, from(xs2)).pipe(skip(2));
52+
const res = catchError(concat(range(0, 2), er1), from(xs2)).pipe(skip(2));
5153

5254
first(res);
5355

0 commit comments

Comments
 (0)