Skip to content

Commit 385e268

Browse files
Merge pull request #85 from basics/beta
Beta
2 parents ca3dfe4 + 271e580 commit 385e268

File tree

5 files changed

+30
-24
lines changed

5 files changed

+30
-24
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/operators/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Project Changelog
22

3+
# [@rxjs-collection/operators-v1.0.7-beta.1](https://github.com/basics/rxjs-collection/compare/@rxjs-collection/operators-v1.0.6...@rxjs-collection/operators-v1.0.7-beta.1) (2024-11-24)
4+
5+
6+
### Bug Fixes
7+
8+
* **operators:** cleanup ([daec245](https://github.com/basics/rxjs-collection/commit/daec245ffb1f6c5ea9001a47cb84a26717c45502))
9+
310
# [@rxjs-collection/operators-v1.0.6](https://github.com/basics/rxjs-collection/compare/@rxjs-collection/operators-v1.0.5...@rxjs-collection/operators-v1.0.6) (2024-11-24)
411

512

packages/operators/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@rxjs-collection/operators",
3-
"version": "1.0.6",
3+
"version": "1.0.7-beta.1",
44
"description": "rxjs operators",
55
"license": "MIT",
66
"contributors": [

packages/operators/src/request/cache.test.js

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,26 +12,27 @@ describe('cache', () => {
1212
});
1313

1414
test('default', () => {
15-
const initial = new Response('initial', { status: 200 });
16-
const updated = new Response('updated', { status: 200 });
17-
const orderedResponses = [initial, updated];
15+
const expectedVal = {
16+
a: new Response('initial', { status: 200 }),
17+
b: new Response('updated', { status: 200 })
18+
};
19+
20+
const triggerVal = [expectedVal.a, expectedVal.b];
1821

1922
testScheduler.run(({ cold, expectObservable }) => {
20-
const stream = cold('a', {
21-
a: () => orderedResponses.shift()
22-
}).pipe(
23+
const stream = cold('a', { a: () => triggerVal.shift() }).pipe(
2324
map(fn => fn()),
2425
cache(2)
2526
);
2627

2728
const unsubA = '-^!';
28-
expectObservable(stream, unsubA).toBe('-a', { a: initial }, new Error());
29+
expectObservable(stream, unsubA).toBe('-a', expectedVal, new Error());
2930

3031
const unsubB = '----^!';
31-
expectObservable(stream, unsubB).toBe('----a', { a: initial }, new Error());
32+
expectObservable(stream, unsubB).toBe('----a', expectedVal, new Error());
3233

3334
const unsubC = '---------^--!';
34-
expectObservable(stream, unsubC).toBe('---------a', { a: updated }, new Error());
35+
expectObservable(stream, unsubC).toBe('---------b', expectedVal, new Error());
3536
});
3637
});
3738
});
Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { map } from 'rxjs';
22
import { TestScheduler } from 'rxjs/testing';
3-
import { afterEach, beforeEach, describe, expect, test } from 'vitest';
3+
import { beforeEach, describe, expect, test } from 'vitest';
44

55
import { log } from '../log';
66
import { networkRetry } from './retry';
@@ -12,28 +12,26 @@ describe('request retry', () => {
1212
testScheduler = new TestScheduler((actual, expected) => expect(actual).deep.equal(expected));
1313
});
1414

15-
afterEach(() => {
16-
//
17-
});
18-
1915
test('2x error -> 1x success', () => {
20-
const error = new Response('', { status: 500 });
21-
const success = new Response('a', { status: 200 });
22-
const orderedResponses = [error, error, success];
16+
const expectedVal = {
17+
a: new Response('', { status: 500 }),
18+
b: new Response('', { status: 500 }),
19+
c: new Response('a', { status: 200 })
20+
};
21+
22+
const triggerVal = [expectedVal.a, expectedVal.b, expectedVal.c];
2323

2424
testScheduler.run(({ cold, expectObservable }) => {
2525
// retry is repeating the sequence
2626
// if you define a delay, you have to add the delay to the subscribe multiple times (num retries)
27-
const stream = cold('a|', {
28-
a: () => orderedResponses.shift()
29-
}).pipe(
27+
const stream = cold('a|', { a: () => triggerVal.shift() }).pipe(
3028
map(fn => fn()),
3129
networkRetry({ timeout: () => 5 }),
3230
log('marble:result')
3331
);
3432

3533
const unsubA = '^-----------';
36-
expectObservable(stream, unsubA).toBe('----------a|', { a: success });
34+
expectObservable(stream, unsubA).toBe('----------c|', expectedVal);
3735
});
3836
});
3937
});

0 commit comments

Comments
 (0)