Skip to content

Commit

Permalink
feat: Add reload to tabs
Browse files Browse the repository at this point in the history
  • Loading branch information
therynamo authored and Bryan Clark committed May 20, 2020
1 parent 94a5826 commit 9838522
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
9 changes: 9 additions & 0 deletions __tests__/tabs.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,4 +103,13 @@ describe('browser.tabs', () => {
expect(callback).toHaveBeenCalledTimes(0);
});
});
test('reload', (done) => {
const callback = jest.fn(() => done());
expect(jest.isMockFunction(chrome.tabs.reload)).toBe(true);

chrome.tabs.reload(1, {}, callback);

expect(chrome.tabs.reload).toHaveBeenCalledTimes(1);
expect(callback).toHaveBeenCalledTimes(1);
});
});
1 change: 1 addition & 0 deletions src/tabs.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,5 @@ export const tabs = {
hasListener: jest.fn(),
},
sendMessage: jest.fn(),
reload: jest.fn((tabId, reloadProperties, cb) => cb()),
};

0 comments on commit 9838522

Please sign in to comment.