change versioning pattern to apply for not strict semvers

pull/171/head
Kai Biermeier 2020-11-02 18:00:53 +01:00
parent 8ad85767e7
commit 70f2ac969a
No known key found for this signature in database
GPG Key ID: 7CC9CD98828758A3
3 changed files with 11 additions and 4 deletions

File diff suppressed because one or more lines are too long

View File

@ -68,7 +68,7 @@ export default class Versioning {
* Regex to parse version description into separate fields * Regex to parse version description into separate fields
*/ */
static get descriptionRegex() { static get descriptionRegex() {
return /^v([\d.]+)-(\d+)-g(\w+)-?(\w+)*/g; return /^v(\d[\w.]*)-(\d+)-g(\w+)-?(\w+)*/g;
} }
static async determineVersion(strategy, inputVersion) { static async determineVersion(strategy, inputVersion) {

View File

@ -127,8 +127,15 @@ describe('Versioning', () => {
expect(Versioning.descriptionRegex).toBeInstanceOf(RegExp); expect(Versioning.descriptionRegex).toBeInstanceOf(RegExp);
}); });
test.each(['v1.1-1-g12345678', 'v0.1-2-g12345678', 'v0.0-500-gA9B6C3D0-dirty'])( test.each(
'is happy with valid %s', [
'v1.1-1-g12345678',
'v0.1-2-g12345678',
'v0.0-500-gA9B6C3D0-dirty',
'v0.0-500a-gA9B6C3D0-dirty',
'v0.1.0a-26-g6817b33',
'is happy with valid %s',
],
(description) => { (description) => {
expect(Versioning.descriptionRegex.test(description)).toBeTruthy(); expect(Versioning.descriptionRegex.test(description)).toBeTruthy();
}, },