Skip to content

Commit

Permalink
Add: simple test to see if the promise is rejected
Browse files Browse the repository at this point in the history
  • Loading branch information
superKalo committed Nov 23, 2017
1 parent 935b6fd commit 557f50b
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions test/data-management.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,4 +165,20 @@ describe('Data Management', () => {
});
});
});

it('Should reject the promise', done => {
const repo = new SuperRepo({
storage: 'LOCAL_VARIABLE',
name: 'test',
outOfDateAfter: 0,
request: () => {
return new Promise((resolve, reject) => reject('whatever'));
}
});

repo.getData()
.catch( () => {
expect(true).to.equal(true);
}).then(done, done);
});
});

0 comments on commit 557f50b

Please sign in to comment.