Skip to content

Commit

Permalink
Merge branch 'master' into deps-remove-wolfy87-eventemitter
Browse files Browse the repository at this point in the history
  • Loading branch information
TheRealNate authored Jun 7, 2023
2 parents 89e5a01 + 69ceffd commit 83c1fa9
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 20 deletions.
46 changes: 30 additions & 16 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,12 @@
"nyc": "15.1.0",
"prettier": "2.7.1",
"rewiremock": "3.14.3",
"sinon": "12.0.1"
"sinon": "12.0.1",
"@react-native-community/netinfo": "*",
"react": "*"
},
"optionalDependencies": {
"@react-native-community/async-storage": ">=1.12.1"
"@react-native-async-storage/async-storage": ">=1.13.0"
},
"peerDependencies": {
"@react-native-community/netinfo": "*",
Expand Down
4 changes: 2 additions & 2 deletions src/Meteor.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ const Meteor = {
return {
AsyncStorage:
Data._options.AsyncStorage ||
require('@react-native-community/async-storage').default,
require('@react-native-async-storage/async-storage').default,
};
},
connect(endpoint, options) {
Expand All @@ -91,7 +91,7 @@ const Meteor = {

if (!options.AsyncStorage) {
const AsyncStorage =
require('@react-native-community/async-storage').default;
require('@react-native-async-storage/async-storage').default;

if (AsyncStorage) {
options.AsyncStorage = AsyncStorage;
Expand Down
11 changes: 11 additions & 0 deletions test/src/Meteor.tests.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { expect } from 'chai';
import Meteor from '../../src/Meteor';

describe('Meteor - integration', function () {
it('uses the default async storage if none is defined', function () {
const fallback =
require('@react-native-async-storage/async-storage').default;
const { AsyncStorage } = Meteor.packageInterface();
expect(AsyncStorage).to.equal(fallback);
});
});

0 comments on commit 83c1fa9

Please sign in to comment.