change versioning pattern to apply for not strict semvers
parent
8ad85767e7
commit
70f2ac969a
File diff suppressed because one or more lines are too long
|
|
@ -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) {
|
||||||
|
|
|
||||||
|
|
@ -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();
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue