From 69a2106987fea44fe1f6fbbba5cfe1019473eca9 Mon Sep 17 00:00:00 2001 From: Michael Contento Date: Mon, 29 Feb 2016 09:57:35 +0100 Subject: [PATCH] add tests for PR #4 --- src/__tests__/index-test.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/__tests__/index-test.js b/src/__tests__/index-test.js index 21dbccc..f06327d 100644 --- a/src/__tests__/index-test.js +++ b/src/__tests__/index-test.js @@ -42,6 +42,15 @@ describe('engine', () => { spy.should.have.been.calledWith({ key: 'value' }); }); + it('should pass the result of .then forward', () => { + const engine = localStorageFakePromise('key'); + const spy = sinon.spy(); + + engine.load().then(() => 'nextValue').then(spy); + + spy.should.have.been.calledWith('nextValue'); + }); + it('should support then without a callback', () => { const engine = localStorageFakePromise('foo');