File tree Expand file tree Collapse file tree 3 files changed +28
-16
lines changed Expand file tree Collapse file tree 3 files changed +28
-16
lines changed Original file line number Diff line number Diff line change 192192 "version" : " 0.41.2"
193193 },
194194 "dependencies" : {
195- "react-native-crypto-algorithm" : " ^ 1.0.2"
195+ "react-native-crypto-algorithm" : " 1.0.2"
196196 }
197197}
Original file line number Diff line number Diff line change 11import Crypto from 'react-native-crypto-algorithm' ;
22
3- jest . mock ( 'react-native-crypto-algorithm' , ( ) => ( {
4- hashSHA256 : jest . fn ( ) ,
5- encryptAES : jest . fn ( ) ,
6- decryptAES : jest . fn ( ) ,
7- genRSAKeyPair : jest . fn ( ) ,
8- encryptRSA : jest . fn ( ) ,
9- decryptRSA : jest . fn ( ) ,
10- genHmacSecretKey : jest . fn ( ) ,
11- encryptHmacAes : jest . fn ( ) ,
12- decryptHmacAes : jest . fn ( ) ,
13- verifyHmac : jest . fn ( ) ,
14- } ) ) ;
15-
163describe ( 'Crypto' , ( ) => {
4+ beforeEach ( ( ) => {
5+ jest . mock ( 'react-native-crypto-algorithm' , ( ) => ( {
6+ hashSHA256 : jest . fn ( ) ,
7+ encryptAES : jest . fn ( ) ,
8+ decryptAES : jest . fn ( ) ,
9+ genRSAKeyPair : jest . fn ( ) ,
10+ encryptRSA : jest . fn ( ) ,
11+ decryptRSA : jest . fn ( ) ,
12+ genHmacSecretKey : jest . fn ( ) ,
13+ encryptHmacAes : jest . fn ( ) ,
14+ decryptHmacAes : jest . fn ( ) ,
15+ verifyHmac : jest . fn ( ) ,
16+ } ) ) ;
17+ } )
18+
1719 it ( 'should hash value using SHA256' , async ( ) => {
1820 const mockValue = 'Hello123' ;
1921 const mockHash = '134563d4e440f0e418b0f382f23a2cf301af6d7f648ccfae9895018345d779a3' ;
Original file line number Diff line number Diff line change @@ -10833,7 +10833,17 @@ __metadata:
1083310833 languageName : unknown
1083410834 linkType : soft
1083510835
10836- " react-native-crypto-algorithm@^1.0.2, react-native-crypto-algorithm@workspace:., react-native-crypto-algorithm@workspace:^ " :
10836+ " react-native-crypto-algorithm@npm:1.0.2 " :
10837+ version : 1.0.2
10838+ resolution : " react-native-crypto-algorithm@npm:1.0.2"
10839+ peerDependencies :
10840+ react : " *"
10841+ react-native : " *"
10842+ checksum : 35cc06cc95b53d6520980041a875df5866883186ac8a1a152694ec027f7d2bcce85e1a6bdab8f26011b594cb75c928d65c2f75cdc06581e95f101316f226a4f4
10843+ languageName : node
10844+ linkType : hard
10845+
10846+ " react-native-crypto-algorithm@workspace:., react-native-crypto-algorithm@workspace:^ " :
1083710847 version : 0.0.0-use.local
1083810848 resolution : " react-native-crypto-algorithm@workspace:."
1083910849 dependencies :
@@ -10853,7 +10863,7 @@ __metadata:
1085310863 react : 18.3.1
1085410864 react-native : 0.75.4
1085510865 react-native-builder-bob : ^0.30.2
10856- react-native-crypto-algorithm : ^ 1.0.2
10866+ react-native-crypto-algorithm : 1.0.2
1085710867 release-it : ^15.0.0
1085810868 turbo : ^1.10.7
1085910869 typescript : ^5.2.2
You can’t perform that action at this time.
0 commit comments