npm.io
1.0.1 • Published 9 years ago

asyncstorage-mock-another

Licence
MIT
Version
1.0.1
Deps
0
Vulns
0
Weekly
0
Stars
4

AsyncStorage Mock Another

Another package (there is already asyncstorage-mock) to mock the AsyncStorage API from React Native. This will give you a non-persistent in-memory database based on a simple JavaScript object. Use this package for testing "headless" React Native apps.

Installation

npm install asyncstorage-mock-another

Usage

var AsyncStorage = require('asyncstorage-mock-another')

AsyncStorage.setItem('age', 22, (err1) => {
  AsyncStorage.getItem('age', (err2, ageValue) => {
    console.log('ageValue', ageValue, 'should be 22')
  })
})

License

MIT