Skip to content

Commit

Permalink
Fix a test case which might fail when run locally using IPv4 (#10434)
Browse files Browse the repository at this point in the history
  • Loading branch information
mingjunlu committed Mar 14, 2024
1 parent ee07e62 commit 2436c9d
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions packages/astro/test/ssr-api-route.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,14 @@ describe('API routes in SSR', () => {
assert.equal(data.propsExist, true);
assert.deepEqual(data.params, { param: 'any' });
assert.match(data.generator, /^Astro v/);
assert.equal(data.url, 'http://[::1]:4321/blog/context/any');
assert.equal(data.clientAddress, '::1');
assert.equal(
[
'http://[::1]:4321/blog/context/any',
'http://127.0.0.1:4321/blog/context/any',
].includes(data.url),
true
);
assert.equal(['::1', '127.0.0.1'].includes(data.clientAddress), true);
assert.equal(data.site, 'https://mysite.dev/subsite/');
});
});
Expand Down

0 comments on commit 2436c9d

Please sign in to comment.