File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ jest.dontMock('../ParseObject');
10
10
jest . dontMock ( '../RESTController' ) ;
11
11
jest . dontMock ( '../Socket.weapp' ) ;
12
12
jest . dontMock ( '../Storage' ) ;
13
+ jest . dontMock ( '../uuid' ) ;
13
14
jest . dontMock ( 'crypto-js/aes' ) ;
14
15
jest . dontMock ( './test_helpers/mockWeChat' ) ;
15
16
@@ -18,6 +19,10 @@ const mockWeChat = require('./test_helpers/mockWeChat');
18
19
19
20
global . wx = mockWeChat ;
20
21
22
+ jest . mock ( 'uuid/v4' , ( ) => {
23
+ return ( ) => 0 ;
24
+ } ) ;
25
+
21
26
describe ( 'WeChat' , ( ) => {
22
27
beforeEach ( ( ) => {
23
28
process . env . PARSE_BUILD = 'weapp' ;
@@ -55,6 +60,12 @@ describe('WeChat', () => {
55
60
expect ( websocket ) . toEqual ( socket ) ;
56
61
} ) ;
57
62
63
+ it ( 'load uuid module' , ( ) => {
64
+ const uuidv4 = require ( '../uuid' ) ;
65
+ expect ( uuidv4 ( ) ) . not . toEqual ( 0 ) ;
66
+ expect ( uuidv4 ( ) ) . not . toEqual ( uuidv4 ( ) ) ;
67
+ } ) ;
68
+
58
69
describe ( 'Socket' , ( ) => {
59
70
it ( 'send' , ( ) => {
60
71
const Websocket = require ( '../Socket.weapp' ) ;
You can’t perform that action at this time.
0 commit comments