Allow plus in semver [Nexus aur bintray chocolatey dubversion myget nuget powershellgallery resharper] (#2987)

* Also allow + in semver

* Add test for + in semver version

* Add more dashes to test version

* Fix tests
This commit is contained in:
Hugo van Rijswijk
2019-02-13 17:50:21 +01:00
committed by Caleb Cartwright
parent b87d67bb18
commit 56d374a467
3 changed files with 21 additions and 3 deletions

View File

@@ -86,6 +86,24 @@ t.create('live: repository version of an inexistent artifact')
value: 'artifact not found',
})
t.create('snapshot version with + in version')
.get(
'/s/https/repository.jboss.org/nexus/com.progress.fuse/fusehq.json?style=_shields_test'
)
.intercept(nock =>
nock('https://repository.jboss.org/nexus')
.get('/service/local/lucene/search')
.query({ g: 'com.progress.fuse', a: 'fusehq' })
.reply(200, { data: [{ version: '7.0.1+19-8844c122-SNAPSHOT' }] })
)
.expectJSONTypes(
Joi.object().keys({
name: 'nexus',
color: 'orange',
value: isVersion,
})
)
t.create('search snapshot version not in latestSnapshot')
.get(
'/s/https/repository.jboss.org/nexus/com.progress.fuse/fusehq.json?style=_shields_test'

View File

@@ -21,9 +21,9 @@ const isVPlusDottedVersionNClauses = withRegex(/^v\d+(\.\d+)*$/)
// matches a version number with N 'clauses'
// and an optional text suffix
// e.g: -beta, -preview1, -release-candidate etc
// e.g: -beta, -preview1, -release-candidate, +beta etc
const isVPlusDottedVersionNClausesWithOptionalSuffix = withRegex(
/^v\d+(\.\d+)*(-.*)?$/
/^v\d+(\.\d+)*([-+].*)?$/
)
// Simple regex for test Composer versions rule

View File

@@ -21,7 +21,7 @@ module.exports = {
.required(),
optionalDottedVersionNClausesWithOptionalSuffix: Joi.string().regex(
/^\d+(\.\d+)*(-.*)?$/
/^\d+(\.\d+)*([-+].*)?$/
),
// TODO This accepts URLs with query strings and fragments, which for some