diff --git a/__mocks__/@react-native-async-storage/async-storage.js b/__mocks__/@react-native-async-storage/async-storage.js index e312481..21cd2ec 100644 --- a/__mocks__/@react-native-async-storage/async-storage.js +++ b/__mocks__/@react-native-async-storage/async-storage.js @@ -1 +1 @@ -module.exports = require('@react-native-async-storage/async-storage/jest/async-storage-mock') +module.exports.default = require('@react-native-async-storage/async-storage/jest/async-storage-mock') diff --git a/browser-version/lib/storage.react-native.js b/browser-version/lib/storage.react-native.js index 977d232..11a0af7 100755 --- a/browser-version/lib/storage.react-native.js +++ b/browser-version/lib/storage.react-native.js @@ -6,7 +6,8 @@ * * This version is the react-native version */ -const AsyncStorage = require('@react-native-async-storage/async-storage') +const AsyncStorage = require('@react-native-async-storage/async-storage').default + const exists = (filename, cback) => { // eslint-disable-next-line node/handle-callback-err AsyncStorage.getItem(filename, (err, value) => { diff --git a/test/react-native/persistence.test.js b/test/react-native/persistence.test.js index 69b4735..7349a85 100644 --- a/test/react-native/persistence.test.js +++ b/test/react-native/persistence.test.js @@ -1,7 +1,7 @@ /* eslint-env jest */ // Forked from https://github.com/antoniopresto/react-native-local-mongodb/blob/93acbc8a9aaca86aed1d632855cd8b984501147b/test/persistence.test.js const { promisify } = require('util') -const AsyncStorage = require('@react-native-async-storage/async-storage') +const AsyncStorage = require('@react-native-async-storage/async-storage').default const DataStore = require('../../') const getDb = async () => {