UNPKG

react-native-unique-id

Version:
27 lines (22 loc) 530 B
const test = require('tape') const uniqueId = require('../index') const AsyncStorage = require('@react-native-community/async-storage').default let theId test('with no store', assert => { AsyncStorage.clear() .then(() => uniqueId()) .then(id => { theId = id assert.ok(id) assert.end() }) .catch(error => assert.error(error)) }) test('with store', assert => { uniqueId() .then(id => { assert.equal(id, theId) assert.end() }) .catch(error => assert.error(error)) })