Skip to content

Commit

Permalink
New jest functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisronline committed Jan 16, 2018
1 parent 6811461 commit 16d34d8
Showing 1 changed file with 1 addition and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,18 +58,7 @@ describe('getIndices', () => {
search: () => { throw 'Fail'; }
};

// https://github.com/facebook/jest/issues/1377
const syncify = async (fn) => {
try {
const result = await fn();
return () => { return result; };
} catch (e) {
return () => { throw e; };
}
};

const fn = await syncify(() => getIndices(es, 'kibana', 1));
expect(fn).toThrow();
await expect(getIndices(es, 'kibana', 1)).rejects.toThrow();
});

it('should handle index_not_found_exception errors gracefully', async () => {
Expand Down

0 comments on commit 16d34d8

Please sign in to comment.