Sha256: a1c8f9f903dc2b4f22caf9b5d0e9245746c863b0460d041308db86d73f7a0073
Contents?: true
Size: 550 Bytes
Versions: 26
Compression:
Stored size: 550 Bytes
Contents
/** * @vitest-environment jsdom */ import { toPublicUrl } from './toPublicUrl' test('returns an absolute request URL withouth search params', () => { expect(toPublicUrl(new URL('https://test.mswjs.io/path'))).toBe( 'https://test.mswjs.io/path', ) expect(toPublicUrl(new URL('http://localhost/path'))).toBe('/path') expect(toPublicUrl(new URL('http://localhost/path?foo=bar'))).toBe('/path') }) it('returns a relative URL given the request to the same origin', () => { expect(toPublicUrl('http://localhost/user')).toBe('/user') })
Version data entries
26 entries across 26 versions & 1 rubygems