Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file removed .DS_Store
Binary file not shown.
21 changes: 18 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,13 @@

# npm / yarn
node_modules/
npm-debug.log
yarn-error.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Testing
coverage/
.nyc_output

# Xcode
#
Expand All @@ -32,4 +37,14 @@ android/build
.idea
.gradle
local.properties
*.iml
*.iml

# React Native
*.jsbundle
ios/Pods/

# Test apps (these are generated and shouldn't be committed)
CryptoTestApp/

# asdf
.tool-versions
42 changes: 40 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,47 @@ All methods are asynchronous and return promises (except for convert utils)
>
> `"Raw" (RSA-only) | "SHA1" | "SHA224" | "SHA256" | "SHA384" | "SHA512"`

## Example
## Testing

This library includes comprehensive unit tests and E2E testing capabilities.

### Unit Tests

```bash
# Install dependencies
npm install

# Run all unit tests
npm test

# Run tests in watch mode (recommended for development)
npm run test:watch

# Run tests with coverage report
npm run test:coverage
```

### E2E Testing

For end-to-end testing with real native modules, create a test app:

```bash
# Use the automated setup script
./scripts/create-test-app.sh

# Or manually create a test app
npx @react-native-community/cli@latest init CryptoTestApp --skip-install
cd CryptoTestApp
npm install
npm install ../
npm install base64-js hex-lite
cd ios && bundle install && bundle exec pod install && cd ..
npm run ios
```

Testing [repository](https://github.com/ghbutton/react-native-simple-crypto-test).
The test app provides interactive testing of all crypto functions on real simulators/emulators and is ready to use immediately.

## Example

```javascript
import RNSimpleCrypto from "react-native-simple-crypto";
Expand Down
Loading