Skip to content

Commit

Permalink
Mock vscode (#79-2)
Browse files Browse the repository at this point in the history
  • Loading branch information
bmingles committed Aug 9, 2024
1 parent 1bc0473 commit 684f096
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
5 changes: 5 additions & 0 deletions __mocks__/vscode.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { vi } from 'vitest';

export const workspace = {
getConfiguration: vi.fn().mockReturnValue(new Map()),
};
7 changes: 2 additions & 5 deletions src/services/Config.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,8 @@ import { beforeEach, describe, expect, it, Mock, vi } from 'vitest';
import { Config } from './Config';
import { CONFIG_CORE_SERVERS } from '../common';

vi.mock('vscode', () => ({
workspace: {
getConfiguration: vi.fn().mockReturnValue(new Map()),
},
}));
// See __mocks__/vscode.ts for the mock implementation
vi.mock('vscode');

let configMap: Map<string, unknown>;

Expand Down

0 comments on commit 684f096

Please sign in to comment.