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');
1010jest . dontMock ( '../RESTController' ) ;
1111jest . dontMock ( '../Socket.weapp' ) ;
1212jest . dontMock ( '../Storage' ) ;
13+ jest . dontMock ( '../uuid' ) ;
1314jest . dontMock ( 'crypto-js/aes' ) ;
1415jest . dontMock ( './test_helpers/mockWeChat' ) ;
1516
@@ -18,6 +19,10 @@ const mockWeChat = require('./test_helpers/mockWeChat');
1819
1920global . wx = mockWeChat ;
2021
22+ jest . mock ( 'uuid/v4' , ( ) => {
23+ return ( ) => 0 ;
24+ } ) ;
25+
2126describe ( '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' ) ;
You can’t perform that action at this time.
0 commit comments