Skip to content

Commit

Permalink
Merge pull request #12068 from qmonmert/vifn
Browse files Browse the repository at this point in the history
ESLint: fix no-empty-function
  • Loading branch information
murdos authored Mar 9, 2025
2 parents 8604177 + f740eb7 commit df4b41d
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -741,7 +741,7 @@ describe('Landscape', () => {
const wrapper = wrap({ modules });
await flushPromises();

const consoleErrors = vi.spyOn(console, 'error').mockImplementation(() => {});
const consoleErrors = vi.spyOn(console, 'error').mockImplementation(vi.fn());
await updatePath(wrapper);

expect(console.error).not.toHaveBeenCalled();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ describe('LandscapePresetConfigurationComponent', () => {
});

it('should handle API error', async () => {
const consoleErrors = vi.spyOn(console, 'error').mockImplementation(() => {});
const consoleErrors = vi.spyOn(console, 'error').mockImplementation(vi.fn());
const error = new Error('API Error');
const modulesRepository = repositoryWithPresetError(error);
const wrapper = wrap(modulesRepository);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ describe('Modules', () => {
});

it('should catch error when waiting for modules error', () => {
const consoleErrors = vi.spyOn(console, 'error').mockImplementation(() => {});
const consoleErrors = vi.spyOn(console, 'error').mockImplementation(vi.fn());
try {
const { modules, projectFolders, moduleParameters }: WrapperOptions = {
modules: repositoryWithModulesError(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,21 @@ import { describe, expect, it, vi } from 'vitest';

describe('WindowApplicationListener', () => {
it('should add event listener on window', () => {
vi.spyOn(window, 'addEventListener').mockImplementation(() => {});
vi.spyOn(window, 'addEventListener').mockImplementation(vi.fn());

const windowApplicationListener = new WindowApplicationListener(window);

windowApplicationListener.addEventListener('success', () => {});
windowApplicationListener.addEventListener('success', vi.fn());

expect(window.addEventListener).toHaveBeenCalledOnce();
});

it('should remove event listener on window', () => {
vi.spyOn(window, 'removeEventListener').mockImplementation(() => {});
vi.spyOn(window, 'removeEventListener').mockImplementation(vi.fn());

const windowApplicationListener = new WindowApplicationListener(window);

windowApplicationListener.removeEventListener('success', () => {});
windowApplicationListener.removeEventListener('success', vi.fn());

expect(window.removeEventListener).toHaveBeenCalledOnce();
});
Expand Down

0 comments on commit df4b41d

Please sign in to comment.