Skip to content
This repository was archived by the owner on Feb 26, 2024. It is now read-only.

Commit ed59082

Browse files
committed
fix: simulated HTTP errors now delayed as expected
1 parent f673b1c commit ed59082

14 files changed

+8144
-17
lines changed

CHANGELOG.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,19 @@ because this is a development tool, not a production product.
88
We do try to tell you about such changes in this `CHANGELOG.md`
99
and we fix bugs as fast as we can.
1010

11-
<a id="0.5.2"></a>
11+
12+
<a id="0.5.4"></a>
13+
## 0.5.4 (2018-03-09)
14+
15+
Simulated HTTP error responses were not delaying the prescribed time when using RxJS `delay()`
16+
because it was short-circuited by the ErrorResponse.
17+
New `delayResponse` function does it right.
18+
Should not break you unless you incorrectly expected no delay for errors.
19+
20+
Also, this library no longer calls RxJS `delay()` which may make testing with it easier
21+
(Angular TestBed does not handle RxJS `delay()` well because that operator uses `interval()`).
22+
23+
<a id="0.5.3"></a>
1224
## 0.5.3 (2018-01-06)
1325
Can make use of `HttpParams` which yields a `request.urlWithParams`.
1426
Added supporting `HeroService.searchHeroes(term: string)` and test.

backend.service.js

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

backend.service.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bundles/in-memory-web-api.umd.js

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

delay-response.d.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import { Observable } from 'rxjs/Observable';
2+
/** adds specified delay (in ms) to both next and error channels of the response observable */
3+
export declare function delayResponse<T>(response$: Observable<T>, delayMs: number): Observable<T>;

delay-response.js

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

delay-response.js.map

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

delay-response.metadata.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[{"__symbolic":"module","version":3,"metadata":{"delayResponse":{"__symbolic":"function","parameters":["response$","delayMs"],"value":{"__symbolic":"error","message":"Function call not supported","line":4,"character":27}}}},{"__symbolic":"module","version":1,"metadata":{"delayResponse":{"__symbolic":"function","parameters":["response$","delayMs"],"value":{"__symbolic":"error","message":"Function call not supported","line":4,"character":27}}}}]

0 commit comments

Comments
 (0)