Skip to content

Commit

Permalink
fix: make browser test more resilient to test order
Browse files Browse the repository at this point in the history
  • Loading branch information
broofa committed Jun 4, 2024
1 parent f7efb7f commit f5c6018
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions test/browser/browser.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@ const version = (result) => expect(result).toBe('4');
const expectations = {
'uuidv1()': v1,
'uuidv4()': v4,
'uuidv6()': v6,
'uuidv7()': v7,
'uuidv3() DNS': v3dns,
'uuidv3() URL': v3url,
'uuidv3() MY_NAMESPACE': v3custom,
'uuidv5() DNS': v5dns,
'uuidv5() URL': v5url,
'uuidv5() MY_NAMESPACE': v5custom,
'uuidv6()': v6,

'uuidv1ToV6()': v1ToV6,
'uuidv6ToV1()': v6ToV1,
Expand All @@ -54,14 +54,14 @@ const expectations = {

'uuid.v1()': v1,
'uuid.v4()': v4,
'uuid.v6()': v6,
'uuid.v7()': v7,
'uuid.v3() DNS': v3dns,
'uuid.v3() URL': v3url,
'uuid.v3() MY_NAMESPACE': v3custom,
'uuid.v5() DNS': v5dns,
'uuid.v5() URL': v5url,
'uuid.v5() MY_NAMESPACE': v5custom,
'uuid.v6()': v6,

'uuid.v1ToV6()': v1ToV6,
'uuid.v6ToV1()': v6ToV1,
Expand Down Expand Up @@ -104,7 +104,10 @@ describe('BrowserStack Local Testing', () => {
titles.push(title);
}

expect(titles).toEqual(expectationTitles.filter(titleFilter));
// Confirm the expected titles are all present
const expectedTitles = expectationTitles.filter(titleFilter);
expect(titles.length).toEqual(expectedTitles.length);
expect(titles.sort()).toEqual(expectedTitles.sort());
}

describe('webpack', () => {
Expand Down

0 comments on commit f5c6018

Please sign in to comment.