From c83c1135adcde9d60943a1e7fee92c504f5d74d9 Mon Sep 17 00:00:00 2001 From: Tanner Reits <47483144+tanner-reits@users.noreply.github.com> Date: Thu, 1 Jun 2023 09:22:55 -0400 Subject: [PATCH] test(options): update version test to account for additional semver cases (#4443) * fixes version test to account for additional semver cases * update version test case comment example Co-authored-by: Ryan Waskiewicz --------- Co-authored-by: Ryan Waskiewicz --- scripts/utils/test/options.spec.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/utils/test/options.spec.ts b/scripts/utils/test/options.spec.ts index 5df1b468c37..4bf62c53f62 100644 --- a/scripts/utils/test/options.spec.ts +++ b/scripts/utils/test/options.spec.ts @@ -88,10 +88,12 @@ describe('release options', () => { expect(version).toBeDefined(); // Expect a version string with the format 0.0.0-dev-[EPOCH_TIME]-[GIT_SHA_7_CHARS] - expect(version).toMatch(new RegExp(`\\d+\\.\\d+\\.\\d+-dev.${FAKE_SYSTEM_TIME_S}.\\w{7}`)); + // or, contain a possible pre-release string like 0.0.0-beta.0-dev-[EPOCH_TIME]-[GIT_SHA_7_CHARS] + + expect(version).toMatch(new RegExp(`\\d+\\.\\d+\\.\\d+(-(.{1,}))?-dev.${FAKE_SYSTEM_TIME_S}.\\w{7}`)); }); - it('uses the provided the version', () => { + it('uses the provided version', () => { const expectedVersion = '3.0.0-dev-1234'; const { version } = getOptions(ROOT_DIR, { version: expectedVersion });