Skip to content

Commit 839cafe

Browse files
committed
test(http): only send a credentials request on Angular versions that know the option
Angular 20.0 has no HttpRequest credentials option and drops it, so the request became a plain GET that used up the test's only transfer cache entry. The Angular compatibility run on main has failed on Angular 20.0 since #361.
1 parent 35f14a0 commit 839cafe

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

‎packages/devtools/src/__tests__/http.test.ts‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -598,8 +598,13 @@ describe('interceptor', () => {
598598
);
599599
await get(new HttpRequest('GET', '/api/trips', null, { transferCache: false }));
600600
await get(new HttpRequest('GET', '/api/trips', null, { withCredentials: true }));
601-
await get(new HttpRequest('GET', '/api/trips', null, { credentials: 'include' }));
602-
expect(httpRegistry().calls?.map((c) => c.cacheHit)).toEqual([false, false, false, false]);
601+
// Angular 20.0 has no credentials option and drops it, which leaves a plain GET.
602+
const include = new HttpRequest('GET', '/api/trips', null, { credentials: 'include' });
603+
const knowsCredentials = include.credentials === 'include';
604+
if (knowsCredentials) await get(include);
605+
expect(httpRegistry().calls?.map((c) => c.cacheHit)).toEqual(
606+
knowsCredentials ? [false, false, false, false] : [false, false, false],
607+
);
603608

604609
const stable = Injector.create({
605610
providers: [

0 commit comments

Comments
 (0)