From 561d3bd82d6da25b4b1024619615791ba12c1fb4 Mon Sep 17 00:00:00 2001 From: LFDM <1986gh@gmail.com> Date: Thu, 3 Aug 2017 09:54:35 +0200 Subject: [PATCH] refactor(builder) Minor formatting of specs --- src/builder.spec.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/builder.spec.js b/src/builder.spec.js index e7df5aa..515dd49 100644 --- a/src/builder.spec.js +++ b/src/builder.spec.js @@ -55,6 +55,7 @@ describe('builder', () => { .then(() => api.user.getUsers()) .then(expectOnlyOneApiCall); }); + it('Two read api calls will return the same output', (done) => { const myConfig = config(); myConfig.user.api.getUsers = sinon.spy(myConfig.user.api.getUsers); @@ -70,6 +71,7 @@ describe('builder', () => { .then(() => api.user.getUsers()) .then(expectOnlyOneApiCall); }); + it('1000 calls is not slow', (done) => { const myConfig = config(); myConfig.user.api.getUsers = sinon.spy(myConfig.user.api.getUsers); @@ -87,6 +89,7 @@ describe('builder', () => { } bc.then(checkTimeConstraint); }); + it('Works with non default id set', (done) => { const myConfig = config(); myConfig.__config = {idField: 'mySecretId', useProductionBuild: true}; @@ -106,6 +109,7 @@ describe('builder', () => { .then(() => api.user.getUsers()) .then(expectOnlyOneApiCall); }); + it('Delete removes value from cached array', (done) => { const myConfig = config(); myConfig.user.api.getUsers = sinon.spy(() => Promise.resolve([{id: 1}, {id: 2}])); @@ -122,6 +126,7 @@ describe('builder', () => { .then(() => api.user.getUsers()) .then(expectUserToBeRemoved); }); + it('TTL set to zero means we never get a cache hit', (done) => { const myConfig = config(); myConfig.user.ttl = 0;