mirror of
https://github.com/pnpm/pnpm.git
synced 2026-04-27 18:46:18 -04:00
* fix: normalize tarball URLs by removing default HTTP/HTTPS ports closes #6725 * feat: refactor, add test and changeset --------- Co-authored-by: Zoltan Kochan <z@kochan.io>
15 lines
955 B
TypeScript
15 lines
955 B
TypeScript
import { normalizeRegistryUrl } from '../lib/normalizeRegistryUrl.js'
|
|
|
|
test.each([
|
|
['https://registry.example.com:443/package.tgz', 'https://registry.example.com/package.tgz'],
|
|
['http://registry.example.com:80/package.tgz', 'http://registry.example.com/package.tgz'],
|
|
['https://registry.example.com:8443/package.tgz', 'https://registry.example.com:8443/package.tgz'],
|
|
['http://registry.example.com:8080/package.tgz', 'http://registry.example.com:8080/package.tgz'],
|
|
['https://registry.example.com/package.tgz', 'https://registry.example.com/package.tgz'],
|
|
['http://registry.example.com/package.tgz', 'http://registry.example.com/package.tgz'],
|
|
['https://artifactory:443/api/npm/npm-virtual/uuid/-/uuid-9.0.1.tgz', 'https://artifactory/api/npm/npm-virtual/uuid/-/uuid-9.0.1.tgz'],
|
|
['invalid-url', 'invalid-url'],
|
|
])('normalizeRegistryUrl(%s) should return %s', (input, expected) => {
|
|
expect(normalizeRegistryUrl(input)).toBe(expected)
|
|
})
|