7e8084be87
* feat(backends): add proxy backend * feat: add proxy server initial commit * fix: move from joi to @hapi/joi * test: add joi validation tests * feat: proxy server initial implementations * test: add tests, fix build * chore: update yarn.lock * build: fix develop command * fix(back-proxy): fix bugs * test(backend-proxy): add cypress tests * chore: cleanup * chore: support node 10 * chore: code cleanup * chore: run cypress on ubuntu 16.04 * test(e2e): fix proxy backend cypress tests * chore: don't start proxy server on yarn develop
22 lines
497 B
TypeScript
22 lines
497 B
TypeScript
import localForage from 'localforage';
|
|
|
|
function localForageTest() {
|
|
const testKey = 'localForageTest';
|
|
localForage
|
|
.setItem(testKey, { expires: Date.now() + 300000 })
|
|
.then(() => {
|
|
localForage.removeItem(testKey);
|
|
})
|
|
.catch(err => {
|
|
if (err.code === 22) {
|
|
const message = 'Unable to set localStorage key. Quota exceeded! Full disk?';
|
|
console.warn(message);
|
|
}
|
|
console.log(err);
|
|
});
|
|
}
|
|
|
|
localForageTest();
|
|
|
|
export default localForage;
|