Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
test(`should handle a delay with a specific retry date time`, () => {
const waitTime = time(`${'-'.repeat(100) }|`);
const emissionTime = new Date(getTestScheduler().now() + waitTime);
const retryErrorWithSpecificDelay = new HttpErrorResponse({
status: 429,
headers: new HttpHeaders({ 'Retry-After': emissionTime.toString() }),
});
getTestScheduler().maxFrames = 1500;
(expect(
errorAfter(3, retryErrorWithSpecificDelay, 1).pipe(
httpRetryer({ scheduler: getTestScheduler() }),
),
) as any).toBeObservable(
// Note the '- 2' account for the time it takes to get to the first error
cold(`ab${ '-'.repeat(100 - 2) }abcd`, {