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:
chris48s
2019-12-23 20:47:35 +00:00
committed by GitHub
parent 8056706316
commit 1a98b6bc31
19 changed files with 294 additions and 154 deletions

View File

@@ -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,
}

View File

@@ -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({