Skip to content

Commit

Permalink
test(options): update version test to account for additional semver c…
Browse files Browse the repository at this point in the history
…ases (#4443)

* fixes version test to account for additional semver cases

* update version test case comment example

Co-authored-by: Ryan Waskiewicz <ryanwaskiewicz@gmail.com>

---------

Co-authored-by: Ryan Waskiewicz <ryanwaskiewicz@gmail.com>
  • Loading branch information
tanner-reits and rwaskiewicz authored Jun 1, 2023
1 parent 2709794 commit c83c113
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions scripts/utils/test/options.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 });

Expand Down

0 comments on commit c83c113

Please sign in to comment.