Skip to content

Commit 83fb442

Browse files
authored
chore(WeChat): Add missing uuid test (#1411)
1 parent 6578f7c commit 83fb442

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/__tests__/weapp-test.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ jest.dontMock('../ParseObject');
1010
jest.dontMock('../RESTController');
1111
jest.dontMock('../Socket.weapp');
1212
jest.dontMock('../Storage');
13+
jest.dontMock('../uuid');
1314
jest.dontMock('crypto-js/aes');
1415
jest.dontMock('./test_helpers/mockWeChat');
1516

@@ -18,6 +19,10 @@ const mockWeChat = require('./test_helpers/mockWeChat');
1819

1920
global.wx = mockWeChat;
2021

22+
jest.mock('uuid/v4', () => {
23+
return () => 0;
24+
});
25+
2126
describe('WeChat', () => {
2227
beforeEach(() => {
2328
process.env.PARSE_BUILD = 'weapp';
@@ -55,6 +60,12 @@ describe('WeChat', () => {
5560
expect(websocket).toEqual(socket);
5661
});
5762

63+
it('load uuid module', () => {
64+
const uuidv4 = require('../uuid');
65+
expect(uuidv4()).not.toEqual(0);
66+
expect(uuidv4()).not.toEqual(uuidv4());
67+
});
68+
5869
describe('Socket', () => {
5970
it('send', () => {
6071
const Websocket = require('../Socket.weapp');

0 commit comments

Comments
 (0)