Skip to content

Commit f17a1a1

Browse files
Copilotmtrezza
andcommitted
Add browser uuid test
Co-authored-by: mtrezza <5673677+mtrezza@users.noreply.github.com>
1 parent 1a2d8fa commit f17a1a1

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/__tests__/browser-test.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ jest.dontMock('../EventEmitter');
77
jest.dontMock('../Parse');
88
jest.dontMock('../RESTController');
99
jest.dontMock('../Storage');
10+
jest.dontMock('../uuid');
1011
jest.dontMock('crypto-js/aes');
1112
jest.setMock('../EventuallyQueue', { poll: jest.fn() });
1213

@@ -151,4 +152,13 @@ describe('Browser', () => {
151152
}
152153
expect(called).toBe(true);
153154
});
155+
156+
it('load uuid module', () => {
157+
const uuidv4 = require('../uuid').default;
158+
const uuid1 = uuidv4();
159+
const uuid2 = uuidv4();
160+
expect(uuid1).toMatch(/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i);
161+
expect(uuid2).toMatch(/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i);
162+
expect(uuid1).not.toEqual(uuid2);
163+
});
154164
});

0 commit comments

Comments
 (0)