Skip to content

Commit f54a866

Browse files
authoredJun 3, 2024··
fix: missing v7 expectations in browser spec (#751)
1 parent db76a12 commit f54a866

File tree

3 files changed

+20
-6
lines changed

3 files changed

+20
-6
lines changed
 

‎examples/browser-rollup/package-lock.json

+7-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎examples/browser-webpack/package-lock.json

+7-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎test/browser/browser.spec.js

+6
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@
22

33
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;
44
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;
5+
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;
56

67
const v1 = (result) => expect(result).toMatch(v1Regex);
78
const v4 = (result) => expect(result).toMatch(v4Regex);
9+
const v7 = (result) => expect(result).toMatch(v7Regex);
810
const v3dns = (result) => expect(result).toBe('9125a8dc-52ee-365b-a5aa-81b0b3681cf6');
911
const v3url = (result) => expect(result).toBe('c6235813-3ba4-3801-ae84-e0a6ebb7d138');
1012
const v3custom = (result) => expect(result).toBe('f5a52d34-dcd7-30f7-b581-0112fab43d0c');
@@ -22,6 +24,7 @@ const version = (result) => expect(result).toBe('4');
2224
const expectations = {
2325
'uuidv1()': v1,
2426
'uuidv4()': v4,
27+
'uuidv7()': v7,
2528
'uuidv3() DNS': v3dns,
2629
'uuidv3() URL': v3url,
2730
'uuidv3() MY_NAMESPACE': v3custom,
@@ -37,6 +40,7 @@ const expectations = {
3740

3841
'uuid.v1()': v1,
3942
'uuid.v4()': v4,
43+
'uuid.v7()': v7,
4044
'uuid.v3() DNS': v3dns,
4145
'uuid.v3() URL': v3url,
4246
'uuid.v3() MY_NAMESPACE': v3custom,
@@ -75,6 +79,8 @@ describe('BrowserStack Local Testing', () => {
7579
const resultEl = await element.$('dd');
7680
const result = await resultEl.getText();
7781

82+
if (!expectations[title]) throw new Error(`Unexpected title: ${title}`);
83+
7884
expectations[title](result);
7985
titles.push(title);
8086
}

0 commit comments

Comments
 (0)
Please sign in to comment.