generating keys and encryption/decryption seem to work for me in React Native environment but fail when I run these functions in jest unit tests:
import { RSA } from "react-native-rsa-native";
const encrypted = await RSA.encrypt("test", <RSA public key I generated on device>);
const decrypted = await RSA.decrypt(encrypted, <RSA private key I generated on device>);
example error:
Cannot read properties of undefined (reading 'encrypt')
Also generating keys on PC doesn't work (same error - properties of undefined).
How do I test code that involves react-native-rsa-native? Is it even possible or do I need to patch these functions to run on a computer?
generating keys and encryption/decryption seem to work for me in React Native environment but fail when I run these functions in jest unit tests:
example error:
Also generating keys on PC doesn't work (same error - properties of undefined).
How do I test code that involves
react-native-rsa-native
? Is it even possible or do I need to patch these functions to run on a computer?