Skip to content

Commit

Permalink
fix: studio.spec.ts
Browse files Browse the repository at this point in the history
Signed-off-by: axel7083 <[email protected]>
  • Loading branch information
axel7083 committed Mar 6, 2024
1 parent 72ce437 commit 9bda4e8
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion packages/backend/src/studio.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

import { afterEach, beforeEach, expect, test, vi } from 'vitest';
import { Studio } from './studio';
import type { ExtensionContext } from '@podman-desktop/api';
import { EventEmitter, ExtensionContext, fs as fsApi } from '@podman-desktop/api';

Check failure on line 23 in packages/backend/src/studio.spec.ts

View workflow job for this annotation

GitHub Actions / linter, formatters and unit tests / windows-2022

Import "ExtensionContext" is only used as types

Check failure on line 23 in packages/backend/src/studio.spec.ts

View workflow job for this annotation

GitHub Actions / linter, formatters and unit tests / windows-2022

'fsApi' is defined but never used

Check failure on line 23 in packages/backend/src/studio.spec.ts

View workflow job for this annotation

GitHub Actions / linter, formatters and unit tests / ubuntu-22.04

Import "ExtensionContext" is only used as types

Check failure on line 23 in packages/backend/src/studio.spec.ts

View workflow job for this annotation

GitHub Actions / linter, formatters and unit tests / ubuntu-22.04

'fsApi' is defined but never used

Check failure on line 23 in packages/backend/src/studio.spec.ts

View workflow job for this annotation

GitHub Actions / linter, formatters and unit tests / macos-12

Import "ExtensionContext" is only used as types

Check failure on line 23 in packages/backend/src/studio.spec.ts

View workflow job for this annotation

GitHub Actions / linter, formatters and unit tests / macos-12

'fsApi' is defined but never used

import * as fs from 'node:fs';

Expand All @@ -39,6 +39,10 @@ const mocks = vi.hoisted(() => ({

vi.mock('@podman-desktop/api', async () => {
return {
fs: {
createFileSystemWatcher: vi.fn(),
},
EventEmitter: vi.fn(),
Uri: class {
static joinPath = () => ({ fsPath: '.' });
},
Expand Down Expand Up @@ -76,6 +80,11 @@ const consoleLogMock = vi.fn();
beforeEach(() => {
vi.clearAllMocks();
console.log = consoleLogMock;

vi.mocked(EventEmitter).mockReturnValue({
event: vi.fn(),
fire: vi.fn(),
} as unknown as EventEmitter<unknown>);
});

afterEach(() => {
Expand Down

0 comments on commit 9bda4e8

Please sign in to comment.