From f54a866cedb2b3b96581157c1f4ac935a0b11411 Mon Sep 17 00:00:00 2001 From: Robert Kieffer Date: Sun, 2 Jun 2024 21:35:44 -0700 Subject: [PATCH] fix: missing v7 expectations in browser spec (#751) --- examples/browser-rollup/package-lock.json | 10 +++++++--- examples/browser-webpack/package-lock.json | 10 +++++++--- test/browser/browser.spec.js | 6 ++++++ 3 files changed, 20 insertions(+), 6 deletions(-) diff --git a/examples/browser-rollup/package-lock.json b/examples/browser-rollup/package-lock.json index d2a40760..a13e5c88 100644 --- a/examples/browser-rollup/package-lock.json +++ b/examples/browser-rollup/package-lock.json @@ -17,7 +17,11 @@ } }, "../../.local/uuid": { - "version": "8.3.2", + "version": "9.0.1", + "funding": [ + "https://github.com/sponsors/broofa", + "https://github.com/sponsors/ctavan" + ], "license": "MIT", "bin": { "uuid": "dist/bin/uuid" @@ -44,7 +48,7 @@ "optional-dev-dependency": "2.0.1", "prettier": "2.7.1", "random-seed": "0.3.0", - "runmd": "1.3.6", + "runmd": "1.3.9", "standard-version": "9.5.0" } }, @@ -995,7 +999,7 @@ "optional-dev-dependency": "2.0.1", "prettier": "2.7.1", "random-seed": "0.3.0", - "runmd": "1.3.6", + "runmd": "1.3.9", "standard-version": "9.5.0" } } diff --git a/examples/browser-webpack/package-lock.json b/examples/browser-webpack/package-lock.json index 167e4081..8513b432 100644 --- a/examples/browser-webpack/package-lock.json +++ b/examples/browser-webpack/package-lock.json @@ -16,7 +16,11 @@ } }, "../../.local/uuid": { - "version": "8.3.2", + "version": "9.0.1", + "funding": [ + "https://github.com/sponsors/broofa", + "https://github.com/sponsors/ctavan" + ], "license": "MIT", "bin": { "uuid": "dist/bin/uuid" @@ -43,7 +47,7 @@ "optional-dev-dependency": "2.0.1", "prettier": "2.7.1", "random-seed": "0.3.0", - "runmd": "1.3.6", + "runmd": "1.3.9", "standard-version": "9.5.0" } }, @@ -2171,7 +2175,7 @@ "optional-dev-dependency": "2.0.1", "prettier": "2.7.1", "random-seed": "0.3.0", - "runmd": "1.3.6", + "runmd": "1.3.9", "standard-version": "9.5.0" } }, diff --git a/test/browser/browser.spec.js b/test/browser/browser.spec.js index 4760e917..df7deb4b 100644 --- a/test/browser/browser.spec.js +++ b/test/browser/browser.spec.js @@ -2,9 +2,11 @@ const v1Regex = /^[0-9A-F]{8}-[0-9A-F]{4}-1[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i; const v4Regex = /^[0-9A-F]{8}-[0-9A-F]{4}-4[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i; +const v7Regex = /^[0-9A-F]{8}-[0-9A-F]{4}-7[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i; const v1 = (result) => expect(result).toMatch(v1Regex); const v4 = (result) => expect(result).toMatch(v4Regex); +const v7 = (result) => expect(result).toMatch(v7Regex); const v3dns = (result) => expect(result).toBe('9125a8dc-52ee-365b-a5aa-81b0b3681cf6'); const v3url = (result) => expect(result).toBe('c6235813-3ba4-3801-ae84-e0a6ebb7d138'); const v3custom = (result) => expect(result).toBe('f5a52d34-dcd7-30f7-b581-0112fab43d0c'); @@ -22,6 +24,7 @@ const version = (result) => expect(result).toBe('4'); const expectations = { 'uuidv1()': v1, 'uuidv4()': v4, + 'uuidv7()': v7, 'uuidv3() DNS': v3dns, 'uuidv3() URL': v3url, 'uuidv3() MY_NAMESPACE': v3custom, @@ -37,6 +40,7 @@ const expectations = { 'uuid.v1()': v1, 'uuid.v4()': v4, + 'uuid.v7()': v7, 'uuid.v3() DNS': v3dns, 'uuid.v3() URL': v3url, 'uuid.v3() MY_NAMESPACE': v3custom, @@ -75,6 +79,8 @@ describe('BrowserStack Local Testing', () => { const resultEl = await element.$('dd'); const result = await resultEl.getText(); + if (!expectations[title]) throw new Error(`Unexpected title: ${title}`); + expectations[title](result); titles.push(title); }