it("should reject the promise if there is an error", () => { global.AsyncStorage.removeItem = sinon.spy(function (key, cb) { cb("error"); }); const ret = multiStorage.del("key"); return expect(ret).to.be.rejectedWith("error"); });
it("should resolve the promise if there isn't any error", () => { global.AsyncStorage.removeItem = sinon.spy(function (key, cb) { cb(undefined); }); const ret = multiStorage.del("key"); return expect(ret).to.become(undefined); });
it("should remove a value from the `genericStorage`", () => { multiStorage.del("key"); expect(genericStorage.key).to.be.equal(undefined); });
it("should remove a value from the `react-native` storage", () => { AsyncStorage.removeItem = sinon.spy(); multiStorage.del("key"); expect(AsyncStorage.removeItem).to.be.calledWith("key"); });
it("should remove a value from the `chrome` storage", () => { multiStorage.del("key"); expect(chrome.storage.local.remove).to.be.calledWith("key"); });
it("should remove a value from the `localStorage`", () => { del("key"); expect(localStorage.key).to.be.equal(undefined); });