mirror of
https://github.com/game-ci/unity-builder.git
synced 2025-07-04 12:25:19 -04:00
Make version pattern slightly less strict
This commit is contained in:
parent
7c90cddd43
commit
250a665fce
BIN
dist/index.js
vendored
BIN
dist/index.js
vendored
Binary file not shown.
@ -27,7 +27,7 @@ export default class ImageTag {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static get versionPattern() {
|
static get versionPattern() {
|
||||||
return /^20\d{2}\.\d\.\w{4}|3$/;
|
return /^20\d{2}\.\d\.\w{3,4}|3$/;
|
||||||
}
|
}
|
||||||
|
|
||||||
static get builderPlatforms() {
|
static get builderPlatforms() {
|
||||||
|
@ -31,17 +31,17 @@ describe('UnityImageVersion', () => {
|
|||||||
expect(image.builderPlatform).toStrictEqual(some.builderPlatform);
|
expect(image.builderPlatform).toStrictEqual(some.builderPlatform);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('throws for incorrect versions', () => {
|
test.each(['2000.0.0f0', '2011.1.11f1'])('accepts %p version format', version => {
|
||||||
const { platform } = some;
|
expect(() => new ImageTag({ version, platform: some.platform })).not.toThrow();
|
||||||
expect(() => new ImageTag({ version: 'some version', platform })).toThrow();
|
|
||||||
expect(() => new ImageTag({ version: '', platform })).toThrow();
|
|
||||||
expect(() => new ImageTag({ version: 1, platform })).toThrow();
|
|
||||||
expect(() => new ImageTag({ version: null, platform })).toThrow();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('throws for incorrect or unsupported targets', () => {
|
test.each(['some version', '', 1, null])('throws for incorrect versions %p', version => {
|
||||||
expect(() => new ImageTag({ platform: undefined })).toThrow();
|
const { platform } = some;
|
||||||
expect(() => new ImageTag({ platform: 'nonExisting' })).toThrow();
|
expect(() => new ImageTag({ version, platform })).toThrow();
|
||||||
|
});
|
||||||
|
|
||||||
|
test.each([undefined, 'nonExisting'])('throws for unsupported target %p', platform => {
|
||||||
|
expect(() => new ImageTag({ platform })).toThrow();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user