mock-async-storage
Advanced tools
Comparing version 2.0.3 to 2.0.4
@@ -44,3 +44,3 @@ 'use strict'; | ||
return _asyncToGenerator(function* () { | ||
const val = _this.store.get(k); | ||
const val = _this.store.get(k) || null; | ||
if (cb) cb(null, val); | ||
@@ -47,0 +47,0 @@ return val; |
{ | ||
"name": "mock-async-storage", | ||
"title": "Jest Mock AsyncStorage for react-native", | ||
"version": "2.0.3", | ||
"version": "2.0.4", | ||
"description": "Its a mock of react-native AsyncStorage for jest tests", | ||
@@ -92,3 +92,4 @@ "main": "lib/index.js", | ||
"Alexis Mangin (http://www.alexismangin.com/)", | ||
"Kees Kluskens (http://webduck.nl)" | ||
"Kees Kluskens (http://webduck.nl)", | ||
"Caleb Gregory (http://caleb-gregory.com)" | ||
], | ||
@@ -95,0 +96,0 @@ "bugs": { |
@@ -19,2 +19,7 @@ /* eslint-env jest */ | ||
it('#getItem returns null if item not in store', async () => { | ||
const foo = await storage.getItem('baz') | ||
expect(foo).toEqual(null) | ||
}) | ||
it('#removeItem', async () => { | ||
@@ -21,0 +26,0 @@ await storage.removeItem('foo') |
@@ -40,3 +40,3 @@ // @flow | ||
async getItem (k: K, cb: ?ErrBack<V>): Promise<?V> { | ||
const val = this.store.get(k) | ||
const val = this.store.get(k) || null | ||
if (cb) cb(null, val) | ||
@@ -43,0 +43,0 @@ return val |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
127543
396