Skip to content

Commit f2fa95b

Browse files
author
Krzysztof Borowy
committed
chore: new info on error, readme for jest
1 parent 8060f54 commit f2fa95b

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,10 @@ getData = async () => {
5656

5757
See docs for [api and more examples.](docs/API.md)
5858

59+
## Writing tests
60+
61+
If you're writing tests using Jest, check out [the docs on how to integrate it with this module.](./docs/Jest-integration.md)
62+
5963
## Contribution
6064

6165
See the [CONTRIBUTING](CONTRIBUTING.md) file for how to help out.

lib/AsyncStorage.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,14 @@ const RCTAsyncStorage =
1717
NativeModules.RNC_AsyncSQLiteDBStorage || NativeModules.RNCAsyncStorage;
1818

1919
if (!RCTAsyncStorage) {
20-
throw new Error(`@RNCommunity/AsyncStorage: NativeModule.RCTAsyncStorage is null.
20+
throw new Error(`[@RNC/AsyncStorage]: NativeModule: AsyncStorage is null.
2121
2222
To fix this issue try these steps:
2323
• Run \`react-native link @react-native-community/async-storage\` in the project root.
2424
• Rebuild and re-run the app.
2525
• Restart the packager with \`--clearCache\` flag.
2626
• If you are using CocoaPods on iOS, run \`pod install\` in the \`ios\` directory and then rebuild and re-run the app.
27+
• If this error shows up while testing with Jest, check out how to mock Async Storage in repository docs.
2728
2829
If none of these fix the issue, please open an issue on the Github repository: https://github.com/react-native-community/react-native-async-storage/issues
2930
`);

0 commit comments

Comments
 (0)