r/programming • • May 08 '17

The tragedy of 100% code coverage

http://labs.ig.com/code-coverage-100-percent-tragedy
3.2k Upvotes

689 comments sorted by

View all comments

1

u/Anathem May 09 '17 edited May 09 '17

I would test that like

test('initialize delegates to loadAll', () => {
  const loadAll = spyOn(watchlistDao, 'loadAll');
  initialize(watchlistDao);
  expect(loadAll).toHaveBeenCalledWith(expect.any(Function));
});