Skip to content

Commit

Permalink
fix: remove throw
Browse files Browse the repository at this point in the history
  • Loading branch information
goosewobbler committed Oct 9, 2024
1 parent 5dc4a01 commit 5fbc51d
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions e2e/api.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -705,20 +705,12 @@ describe('browser.electron', () => {
it('should return the results of the mock execution', async () => {
const mockGetName = await browser.electron.mock('app', 'getName');

await mockGetName.mockImplementationOnce(() => {
throw new Error('thrown error');
});
// TODO: why does `mockReturnValueOnce` not work for returning 'result' here?
await mockGetName.mockImplementation(() => 'result');

await expect(browser.electron.execute((electron) => electron.app.getName())).rejects.toThrow('thrown error');
await expect(browser.electron.execute((electron) => electron.app.getName())).resolves.toBe('result');

expect(mockGetName.mock.results).toStrictEqual([
{
type: 'throw',
value: new Error('thrown error'),
},
{
type: 'return',
value: 'result',
Expand Down

0 comments on commit 5fbc51d

Please sign in to comment.