Skip to content

Commit

Permalink
test: Uncomment toHaveBeenCalledWith assertions
Browse files Browse the repository at this point in the history
  • Loading branch information
maxmilton committed Dec 2, 2023
1 parent 8b1b082 commit 2836701
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
3 changes: 1 addition & 2 deletions test/unit/settings.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@ test('gets stored user settings once on load', async () => {
test('fetches themes.json once and makes no other fetch calls', async () => {
const fetchMock = await load();
expect(fetchMock).toHaveBeenCalledTimes(1);
// TODO: Uncomment once bun supports this.
// expect(fetchMock).toHaveBeenCalledWith('themes.json');
expect(fetchMock).toHaveBeenCalledWith('themes.json');
});

const css = await Bun.file('dist/settings.css').text();
Expand Down
8 changes: 4 additions & 4 deletions test/unit/test-utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,7 @@ describe('render', () => {
const rendered = render(document.createElement('div'));
await rendered.debug();
expect(spy).toHaveBeenCalledTimes(1);
// FIXME: Uncomment when bun:test supports toHaveBeenCalledWith !!!
// expect(spy).toHaveBeenCalledWith('DEBUG:\n<div></div>\n');
expect(spy).toHaveBeenCalledWith('DEBUG:\n<div></div>\n');
spy.mockRestore();
});

Expand All @@ -87,8 +86,9 @@ describe('render', () => {
const rendered = render(main);
await rendered.debug();
expect(spy).toHaveBeenCalledTimes(1);
// FIXME: Uncomment when bun:test supports toHaveBeenCalledWith !!!
// expect(spy).toHaveBeenCalledWith('DEBUG:\n<main>\n <div></div>\n <div></div>\n <div></div>\n</main>\n');
expect(spy).toHaveBeenCalledWith(
'DEBUG:\n<main>\n <div></div>\n <div></div>\n <div></div>\n</main>\n',
);
spy.mockRestore();
});

Expand Down

0 comments on commit 2836701

Please sign in to comment.