Esempio n. 1
0
 it("should reject the promise if there is an error", () => {
     global.AsyncStorage.getItem = sinon.spy(function (key, cb) {
         cb("error", undefined);
     });
     return expect(multiStorage.get("key")).to.be.rejectedWith("error");
 });
Esempio n. 2
0
 it("should resolve the promise with the correct parameters", () => {
     return expect(multiStorage.get("key")).to.become("value");
 });
Esempio n. 3
0
 it("should resolve the promise with the correct parameters", () => {
     global.AsyncStorage.getItem = sinon.spy(function (key, cb) {
         cb(undefined, "value");
     });
     return expect(multiStorage.get("key")).to.become("value");
 });