Convert vpre routes to include_prereleases param in [bower chocolatey clojars packagist powershellgallery pub resharper] (#4436)
* Convert vpre routes to include_prereleases param * add .expectRedirect() helper * test redirects on SVG endpoint
This commit is contained in:
@@ -14,6 +14,7 @@ const apiBaseUrl = 'https://www.powershellgallery.com/api/v2'
|
||||
|
||||
const {
|
||||
NugetVersionService: PowershellGalleryVersion,
|
||||
NugetVersionRedirector: PowershellGalleryVersionRedirector,
|
||||
NugetDownloadService: PowershellGalleryDownloads,
|
||||
} = createServiceFamily({
|
||||
name: 'PowershellGallery',
|
||||
@@ -106,6 +107,7 @@ class PowershellGalleryPlatformSupport extends BaseXmlService {
|
||||
|
||||
module.exports = {
|
||||
PowershellGalleryVersion,
|
||||
PowershellGalleryVersionRedirector,
|
||||
PowershellGalleryDownloads,
|
||||
PowershellGalleryPlatformSupport,
|
||||
}
|
||||
|
||||
@@ -40,16 +40,20 @@ t.create('version (not found)')
|
||||
.expectBadge({ label: 'powershell gallery', message: 'not found' })
|
||||
|
||||
t.create('version (pre) (valid)')
|
||||
.get('/vpre/ACMESharp.json')
|
||||
.get('/v/ACMESharp.json?include_prereleases')
|
||||
.expectBadge({
|
||||
label: 'powershell gallery',
|
||||
message: isVPlusDottedVersionNClausesWithOptionalSuffix,
|
||||
})
|
||||
|
||||
t.create('version (pre) (not found)')
|
||||
.get('/vpre/not-a-real-package.json')
|
||||
.get('/v/not-a-real-package.json?include_prereleases')
|
||||
.expectBadge({ label: 'powershell gallery', message: 'not found' })
|
||||
|
||||
t.create('version (legacy redirect: vpre)')
|
||||
.get('/vpre/ACMESharp.svg', { followRedirect: false })
|
||||
.expectRedirect('/powershellgallery/v/ACMESharp.svg?include_prereleases')
|
||||
|
||||
t.create('platform (valid')
|
||||
.get('/p/DNS.1.1.1.1.json')
|
||||
.expectBadge({
|
||||
|
||||
Reference in New Issue
Block a user