error with default import

pull/17/head
Timothée Rebours 3 years ago
parent 4367b37860
commit 52133bd968
  1. 2
      __mocks__/@react-native-async-storage/async-storage.js
  2. 3
      browser-version/lib/storage.react-native.js
  3. 2
      test/react-native/persistence.test.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')

@ -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) => {

@ -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 () => {

Loading…
Cancel
Save