Skip to content

Commit

Permalink
Fixing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
vidorteg committed Sep 18, 2024
1 parent 999a191 commit f63a07a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions test/devtoolsPanel.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ describe("devtoolsPanel", () => {
describe("update", () => {
it("adds attempts to detect browser version only when visible", async () => {
const dtp = await import("../src/devtoolsPanel");
mockRuntimeConfig.browserFlavor = 'Stable';
dtp.DevToolsPanel.createOrShow(context, mockTelemetry, "", mockRuntimeConfig);
expect(mockPanel.onDidChangeViewState).toHaveBeenCalled();

Expand Down
5 changes: 5 additions & 0 deletions test/helpers/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ export function createFakeVSCode() {
showTextDocument: jest.fn(),
showInformationMessage: jest.fn(),
showWarningMessage: jest.fn().mockResolvedValue({}),
activeColorTheme: {
kind: 1
}
},
workspace: {
createFileSystemWatcher: jest.fn(),
Expand Down Expand Up @@ -140,9 +143,11 @@ export function createFakeVSCode() {
* Create a fake VS Code extension context that can be used in tests
*/
export function createFakeExtensionContext() {
const mockedGlobalState = new Map();
return {
extensionPath: "",
subscriptions: [],
globalState: mockedGlobalState,
workspaceState: {
get: jest.fn(),
update: jest.fn(),
Expand Down

0 comments on commit f63a07a

Please sign in to comment.