File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ jest.dontMock('../EventEmitter');
77jest . dontMock ( '../Parse' ) ;
88jest . dontMock ( '../RESTController' ) ;
99jest . dontMock ( '../Storage' ) ;
10+ jest . dontMock ( '../uuid' ) ;
1011jest . dontMock ( 'crypto-js/aes' ) ;
1112jest . 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 - 9 a - f ] { 8 } - [ 0 - 9 a - f ] { 4 } - 4 [ 0 - 9 a - f ] { 3 } - [ 8 9 a b ] [ 0 - 9 a - f ] { 3 } - [ 0 - 9 a - f ] { 12 } $ / i) ;
161+ expect ( uuid2 ) . toMatch ( / ^ [ 0 - 9 a - f ] { 8 } - [ 0 - 9 a - f ] { 4 } - 4 [ 0 - 9 a - f ] { 3 } - [ 8 9 a b ] [ 0 - 9 a - f ] { 3 } - [ 0 - 9 a - f ] { 12 } $ / i) ;
162+ expect ( uuid1 ) . not . toEqual ( uuid2 ) ;
163+ } ) ;
154164} ) ;
You can’t perform that action at this time.
0 commit comments