parent
178a0437b7
commit
7669827436
|
@ -23,13 +23,13 @@ describe('retry-on-error', () => {
|
||||||
docRegionDefault(mockConsole, ajax);
|
docRegionDefault(mockConsole, ajax);
|
||||||
expect(mockConsole.log.calls.allArgs()).toEqual([
|
expect(mockConsole.log.calls.allArgs()).toEqual([
|
||||||
['Subscribed to AJAX'],
|
['Subscribed to AJAX'],
|
||||||
['Error occured.'],
|
['Error occurred.'],
|
||||||
['Subscribed to AJAX'],
|
['Subscribed to AJAX'],
|
||||||
['Error occured.'],
|
['Error occurred.'],
|
||||||
['Subscribed to AJAX'],
|
['Subscribed to AJAX'],
|
||||||
['Error occured.'],
|
['Error occurred.'],
|
||||||
['Subscribed to AJAX'],
|
['Subscribed to AJAX'],
|
||||||
['Error occured.'],
|
['Error occurred.'],
|
||||||
['data: ', []],
|
['data: ', []],
|
||||||
]);
|
]);
|
||||||
});
|
});
|
||||||
|
|
|
@ -17,7 +17,7 @@ export function docRegionDefault(console, ajax) {
|
||||||
const apiData = ajax('/api/data').pipe(
|
const apiData = ajax('/api/data').pipe(
|
||||||
map((res: any) => {
|
map((res: any) => {
|
||||||
if (!res.response) {
|
if (!res.response) {
|
||||||
console.log('Error occured.');
|
console.log('Error occurred.');
|
||||||
throw new Error('Value expected!');
|
throw new Error('Value expected!');
|
||||||
}
|
}
|
||||||
return res.response;
|
return res.response;
|
||||||
|
|
Loading…
Reference in New Issue