Repository: microsoft/vscode-edge-devtools
Pull request #368 (2021-04-22 20:31:36)

Move tests to test folder
This PR moves all the tests into a separate test folder to help with code clarity in the src folder.

bgoddar: This should wait for Michaels iframe fix first, then I'll rebase: https://github.com/microsoft/vscode-edge-devtools/pull/367/files

Patch:
diff --git a/package.json b/package.json
index abf8f9a..e5c8852 100644
--- a/package.json
+++ b/package.json
@@ -565,7 +565,7 @@
         "transform": {
             "^.+\\.tsx?$": "ts-jest"
         },
-        "testRegex": "/src/.+\\.test\\.tsx?$",
+        "testRegex": "/test/.+\\.test\\.tsx?$",
         "moduleFileExtensions": [
             "ts",
             "tsx",


Test patch:
diff --git a/src/cdpTarget.test.ts b/test/cdpTarget.test.ts
similarity index 85%
rename from src/cdpTarget.test.ts
rename to test/cdpTarget.test.ts
index 7b1ccf2..b9f7b05 100644
--- a/src/cdpTarget.test.ts
+++ b/test/cdpTarget.test.ts
@@ -4,8 +4,8 @@
 // Allow unused variables in the mocks to have leading underscore
 // tslint:disable: variable-name
 
-import { createFakeVSCode } from "./test/helpers";
-import { IRemoteTargetJson } from "./utils";
+import { createFakeVSCode } from "./helpers/helpers";
+import { IRemoteTargetJson } from "../src/utils";
 
 describe("CDPTarget", () => {
     let mockVSCode: typeof import("vscode");
@@ -22,7 +22,7 @@ describe("CDPTarget", () => {
             url: "url",
         } as IRemoteTargetJson;
 
-        const ct = await import("./cdpTarget");
+        const ct = await import("../src/cdpTarget");
         const target = new ct.CDPTarget(json, "");
         expect(target).toBeDefined();
     });
@@ -34,7 +34,7 @@ describe("CDPTarget", () => {
             url: "url",
         } as IRemoteTargetJson;
 
-        const ct = await import("./cdpTarget");
+        const ct = await import("../src/cdpTarget");
         const target = new ct.CDPTarget(json, "", "path");
         expect(target.iconPath).toBeDefined();
         expect(target.iconPath!.dark).toEqual(
@@ -51,7 +51,7 @@ describe("CDPTarget", () => {
             webSocketDebuggerUrl: "webSocketDebuggerUrl",
         } as IRemoteTargetJson;
 
-        const ct = await import("./cdpTarget");
+        const ct = await import("../src/cdpTarget");
         const target = new ct.CDPTarget(json, "");
         target.label = "label";
         expect(target.websocketUrl).toEqual(json.webSocketDebuggerUrl);
@@ -72,7 +72,7 @@ describe("CDPTarget", () => {
             webSocketDebuggerUrl: "webSocketDebuggerUrl",
         } as IRemoteTargetJson;
 
-        const ct = await import("./cdpTarget");
+        const ct = await import("../src/cdpTarget");
         const target = new ct.CDPTarget(json, "");
         expect(target.getChildren().length).toEqual(4);
     });
diff --git a/src/cdpTargetsProvider.test.ts b/test/cdpTargetsProvider.test.ts
similarity index 85%
rename from src/cdpTargetsProvider.test.ts
rename to test/cdpTargetsProvider.test.ts
index 144e760..d4cc4cb 100644
--- a/src/cdpTargetsProvider.test.ts
+++ b/test/cdpTargetsProvider.test.ts
@@ -6,9 +6,9 @@
 
 import { ExtensionContext } from "vscode";
 import TelemetryReporter from "vscode-extension-telemetry";
-import { CDPTarget } from "./cdpTarget";
-import { createFakeExtensionContext, createFakeTelemetryReporter, createFakeVSCode, Mocked } from "./test/helpers";
-import { IRemoteTargetJson } from "./utils";
+import { CDPTarget } from "../src/cdpTarget";
+import { createFakeExtensionContext, createFakeTelemetryReporter, createFakeVSCode, Mocked } from "./helpers/helpers";
+import { IRemoteTargetJson } from "../src/utils";
 
 describe("CDPTargetsProvider", () => {
     let mockContext: ExtensionContext;
@@ -20,19 +20,19 @@ describe("CDPTargetsProvider", () => {
         mockVSCode = createFakeVSCode() as any;
         mockReporter = createFakeTelemetryReporter();
 
-        jest.doMock("./cdpTarget", () => ({ CDPTarget: jest.fn() }));
+        jest.doMock("../src/cdpTarget", () => ({ CDPTarget: jest.fn() }));
         jest.doMock("vscode", () => mockVSCode, { virtual: true });
         jest.resetModules();
     });
 
     it("gets created successfully", async () => {
-        const ctp = await import("./cdpTargetsProvider");
+        const ctp = await import("../src/cdpTargetsProvider");
         const provider = new ctp.CDPTargetsProvider(mockContext, mockReporter);
         expect(provider).toBeDefined();
     });
 
     it("returns the element from getTreeItem", async () => {
-        const ctp = await import("./cdpTargetsProvider");
+        const ctp = await import("../src/cdpTargetsProvider");
         const provider = new ctp.CDPTargetsProvider(mockContext, mockReporter);
         const expectedElement = {} as CDPTarget;
         expect(provider.getTreeItem(expectedElement)).toEqual(expectedElement);
@@ -46,7 +46,7 @@ describe("CDPTargetsProvider", () => {
             };
         } as any;
 
-        const ctp = await import("./cdpTargetsProvider");
+        const ctp = await import("../src/cdpTargetsProvider");
         const provider = new ctp.CDPTargetsProvider(mockContext, mockReporter);
         provider.refresh();
         expect(mockFire).toHaveBeenCalled();
@@ -54,7 +54,7 @@ describe("CDPTargetsProvider", () => {
     });
 
     it("calls getChildren on the element", async () => {
-        const ctp = await import("./cdpTargetsProvider");
+        const ctp = await import("../src/cdpTargetsProvider");
         const provider = new ctp.CDPTargetsProvider(mockContext, mockReporter);
         const expectedChildren = [1, 2, 3];
         const mockElement = {
@@ -86,13 +86,13 @@ describe("CDPTargetsProvider", () => {
                 useHttps: false,
             }),
         };
-        jest.doMock("./utils", () => mockUtils);
-        jest.doMock("./cdpTarget", () => ({
+        jest.doMock("../src/utils", () => mockUtils);
+        jest.doMock("../src/cdpTarget", () => ({
             CDPTarget: jest.fn((json: IRemoteTargetJson) => ({ targetJson: json }))
         }));
         jest.resetModules();
 
-        const ctp = await import("./cdpTargetsProvider");
+        const ctp = await import("../src/cdpTargetsProvider");
         const provider = new ctp.CDPTargetsProvider(mockContext, mockReporter);
         const result = await provider.getChildren();
         expect(result.length).toEqual(allTargets.length);
@@ -105,7 +105,7 @@ describe("CDPTargetsProvider", () => {
     });
 
     it("check if favicons are downloaded and cleared correctly", async () => {
-        const ctp = await import("./cdpTargetsProvider");
+        const ctp = await import("../src/cdpTargetsProvider");
         const fs = require('fs');
         const dir = './resources/favicons/';
 
diff --git a/src/common/settingsProvider.test.ts b/test/common/settingsProvider.test.ts
similarity index 80%
rename from src/common/settingsProvider.test.ts
rename to test/common/settingsProvider.test.ts
index 90890da..eb5a400 100644
--- a/src/common/settingsProvider.test.ts
+++ b/test/common/settingsProvider.test.ts
@@ -1,6 +1,6 @@
 // Copyright (c) Microsoft Corporation. All rights reserved.
 
-import { createFakeVSCode } from "../test/helpers";
+import { createFakeVSCode } from "../helpers/helpers";
 
 // Licensed under the MIT License.
 
@@ -15,7 +15,7 @@ describe("settingsProvider", () => {
 
   describe("GetTabConfiguration", () => {
     it("test that singleton provides the right instance", async () => {
-      const settingsProvider = await import("../common/settingsProvider");
+      const settingsProvider = await import("../../src/common/settingsProvider");
       const instance = settingsProvider.SettingsProvider.instance;
       const instanceB = settingsProvider.SettingsProvider.instance;
       expect(instance).not.toEqual(null);
@@ -24,7 +24,7 @@ describe("settingsProvider", () => {
 
     it("test that the right value is retrieved for networkEnabled configuration", async () => {
       jest.requireMock("vscode");
-      const settingsProvider = await import("../common/settingsProvider");
+      const settingsProvider = await import("../../src/common/settingsProvider");
       const instance = settingsProvider.SettingsProvider.instance;
       expect(instance).not.toEqual(null);
       const result = instance.isNetworkEnabled();
@@ -33,7 +33,7 @@ describe("settingsProvider", () => {
 
     it("test that the right value is retrieved for themeString configuration", async () => {
       jest.requireMock("vscode");
-      const settingsProvider = await import("../common/settingsProvider");
+      const settingsProvider = await import("../../src/common/settingsProvider");
       const instance = settingsProvider.SettingsProvider.instance;
       expect(instance).not.toEqual(null);
       const result = instance.getThemeSettings();
diff --git a/src/common/webviewEvents.test.ts b/test/common/webviewEvents.test.ts
similarity index 95%
rename from src/common/webviewEvents.test.ts
rename to test/common/webviewEvents.test.ts
index 9f3a6ea..9666518 100644
--- a/src/common/webviewEvents.test.ts
+++ b/test/common/webviewEvents.test.ts
@@ -5,7 +5,7 @@ import {
     encodeMessageForChannel,
     parseMessageFromChannel,
     webviewEventNames,
-} from "../common/webviewEvents";
+} from "../../src/common/webviewEvents";
 
 describe("webviewEvents", () => {
     describe("parseMessageFromChannel", () => {
diff --git a/src/debugTelemetryReporter.test.ts b/test/debugTelemetryReporter.test.ts
similarity index 81%
rename from src/debugTelemetryReporter.test.ts
rename to test/debugTelemetryReporter.test.ts
index 4ba80ef..d4e2715 100644
--- a/src/debugTelemetryReporter.test.ts
+++ b/test/debugTelemetryReporter.test.ts
@@ -1,7 +1,7 @@
 // Copyright (c) Microsoft Corporation. All rights reserved.
 // Licensed under the MIT License.
 
-import { createFakeVSCode } from "./test/helpers";
+import { createFakeVSCode } from "./helpers/helpers";
 
 // Allow us to mock the console object for testing
 // eslint-disable no-console
@@ -11,13 +11,13 @@ jest.mock("vscode-extension-telemetry");
 
 describe("debugTelemetryReporter", () => {
     it("gets created successfully", async () => {
-        const dtr = await import("./debugTelemetryReporter");
+        const dtr = await import("../src/debugTelemetryReporter");
         const reporter = new dtr.DebugTelemetryReporter();
         expect(reporter).toBeDefined();
     });
 
     it("sendTelemetryEvent writes to the console", async () => {
-        const dtr = await import("./debugTelemetryReporter");
+        const dtr = await import("../src/debugTelemetryReporter");
         const reporter = new dtr.DebugTelemetryReporter();
 
         global.console.log = jest.fn();
@@ -32,7 +32,7 @@ describe("debugTelemetryReporter", () => {
     });
 
     it("dispose completes", async () => {
-        const dtr = await import("./debugTelemetryReporter");
+        const dtr = await import("../src/debugTelemetryReporter");
         const reporter = new dtr.DebugTelemetryReporter();
         await reporter.dispose();
     });
diff --git a/src/devtoolsPanel.test.ts b/test/devtoolsPanel.test.ts
similarity index 89%
rename from src/devtoolsPanel.test.ts
rename to test/devtoolsPanel.test.ts
index 53c30ed..d0a63fb 100644
--- a/src/devtoolsPanel.test.ts
+++ b/test/devtoolsPanel.test.ts
@@ -6,8 +6,8 @@
 
 import { Disposable, ExtensionContext, WebviewPanel } from "vscode";
 import TelemetryReporter from "vscode-extension-telemetry";
-import { TelemetryData, webviewEventNames } from "./common/webviewEvents";
-import { PanelSocket } from "./panelSocket";
+import { TelemetryData, webviewEventNames } from "../src/common/webviewEvents";
+import { PanelSocket } from "../src/panelSocket";
 import {
     createFakeExtensionContext,
     createFakeTelemetryReporter,
@@ -15,8 +15,8 @@ import {
     getFirstCallback,
     Mocked,
     Writable,
-} from "./test/helpers";
-import { IRuntimeConfig, SETTINGS_PREF_DEFAULTS, SETTINGS_PREF_NAME } from "./utils";
+} from "./helpers/helpers";
+import { IRuntimeConfig, SETTINGS_PREF_DEFAULTS, SETTINGS_PREF_NAME } from "../src/utils";
 
 jest.mock("vscode", () => createFakeVSCode(), { virtual: true });
 
@@ -63,12 +63,12 @@ describe("devtoolsPanel", () => {
         mockPanelSocketFactory = {
             PanelSocket: jest.fn(() => mockPanelSocket),
         };
-        jest.doMock("./panelSocket", () => mockPanelSocketFactory);
+        jest.doMock("../src/panelSocket", () => mockPanelSocketFactory);
 
         mockWebviewEvents = {
             encodeMessageForChannel: jest.fn(),
         };
-        jest.doMock("./common/webviewEvents", () => mockWebviewEvents);
+        jest.doMock("../src/common/webviewEvents", () => mockWebviewEvents);
 
         const mockVSCode = createFakeVSCode();
         mockVSCode.window.createWebviewPanel.mockReturnValue(mockPanel);
@@ -78,14 +78,14 @@ describe("devtoolsPanel", () => {
 
     describe("createOrShow", () => {
         it("registers panel events correctly", async () => {
-            const dtp = await import("./devtoolsPanel");
+            const dtp = await import("../src/devtoolsPanel");
             dtp.DevToolsPanel.createOrShow(context, mockTelemetry, "", mockRuntimeConfig);
             expect(mockPanel.onDidChangeViewState).toHaveBeenCalled();
             expect(mockPanel.onDidDispose).toHaveBeenCalled();
         });
 
         it("calls reveal on existing instance", async () => {
-            const dtp = await import("./devtoolsPanel");
+            const dtp = await import("../src/devtoolsPanel");
             dtp.DevToolsPanel.createOrShow(context, mockTelemetry, "", mockRuntimeConfig);
             dtp.DevToolsPanel.createOrShow(context, mockTelemetry, "", mockRuntimeConfig);
             expect(mockPanel.reveal).toHaveBeenCalled();
@@ -114,7 +114,7 @@ describe("devtoolsPanel", () => {
             mockPanel.webview.onDidReceiveMessage.mockImplementation(addDisposable());
 
             // Create the panel
-            const dtp = await import("./devtoolsPanel");
+            const dtp = await import("../src/devtoolsPanel");
             dtp.DevToolsPanel.createOrShow(context, mockTelemetry, "", mockRuntimeConfig);
             expect(mockPanel.onDidDispose).toHaveBeenCalled();
 
@@ -131,7 +131,7 @@ describe("devtoolsPanel", () => {
 
     describe("update", () => {
         it("adds html to the webview only when visible", async () => {
-            const dtp = await import("./devtoolsPanel");
+            const dtp = await import("../src/devtoolsPanel");
             dtp.DevToolsPanel.createOrShow(context, mockTelemetry, "", mockRuntimeConfig);
             expect(mockPanel.onDidChangeViewState).toHaveBeenCalled();
 
@@ -159,7 +159,7 @@ describe("devtoolsPanel", () => {
                 return mockPanelSocket;
             }));
 
-            const dtp = await import("./devtoolsPanel");
+            const dtp = await import("../src/devtoolsPanel");
             dtp.DevToolsPanel.createOrShow(context, mockTelemetry, "", mockRuntimeConfig);
 
             // The +1 in here is due to the 'close' event. This is an extension event not raised from the Webview.
@@ -174,7 +174,7 @@ describe("devtoolsPanel", () => {
         });
 
         it("forwards webview messages to the panel socket", async () => {
-            const dtp = await import("./devtoolsPanel");
+            const dtp = await import("../src/devtoolsPanel");
             dtp.DevToolsPanel.createOrShow(context, mockTelemetry, "", mockRuntimeConfig);
 
             const expectedMessage = "some message that should be passed through";
@@ -184,7 +184,7 @@ describe("devtoolsPanel", () => {
         });
 
         it("forwards panel socket messages to the webview", async () => {
-            const dtp = await import("./devtoolsPanel");
+            const dtp = await import("../src/devtoolsPanel");
             dtp.DevToolsPanel.createOrShow(context, mockTelemetry, "", mockRuntimeConfig);
 
             const expectedEvent = "message";
@@ -223,7 +223,7 @@ describe("devtoolsPanel", () => {
             });
 
             it("sends telemetry for ready", async () => {
-                const dtp = await import("./devtoolsPanel");
+                const dtp = await import("../src/devtoolsPanel");
                 dtp.DevToolsPanel.createOrShow(context, mockTelemetry, "", mockRuntimeConfig);
 
                 // Ensure it sends connect initially
@@ -238,7 +238,7 @@ describe("devtoolsPanel", () => {
             });
 
             it("does nothing yet for websocket", async () => {
-                const dtp = await import("./devtoolsPanel");
+                const dtp = await import("../src/devtoolsPanel");
                 dtp.DevToolsPanel.createOrShow(context, mockTelemetry, "", mockRuntimeConfig);
 
                 hookedEvents.get("websocket")!();
@@ -246,7 +246,7 @@ describe("devtoolsPanel", () => {
             });
 
             it("sends telemetry for telemetry", async () => {
-                const dtp = await import("./devtoolsPanel");
+                const dtp = await import("../src/devtoolsPanel");
                 dtp.DevToolsPanel.createOrShow(context, mockTelemetry, "", mockRuntimeConfig);
 
                 const expectedPerf: TelemetryData = {
@@ -296,7 +296,7 @@ describe("devtoolsPanel", () => {
                 const expectedState = { ...expectedId, someKey: "someValue" };
                 (context.workspaceState.get as jest.Mock).mockReturnValue(expectedState);
 
-                const dtp = await import("./devtoolsPanel");
+                const dtp = await import("../src/devtoolsPanel");
                 dtp.DevToolsPanel.createOrShow(context, mockTelemetry, "", mockRuntimeConfig);
 
                 hookedEvents.get("getState")!(JSON.stringify(expectedId));
@@ -314,7 +314,7 @@ describe("devtoolsPanel", () => {
             });
 
             it("dispose devtools panel on socket close", async () => {
-                const dtp = await import("./devtoolsPanel");
+                const dtp = await import("../src/devtoolsPanel");
                 dtp.DevToolsPanel.createOrShow(context, mockTelemetry, "", mockRuntimeConfig);
                 hookedEvents.get("close")!();
                 expect(mockPanelSocket.dispose).toBeCalled();
@@ -323,7 +323,7 @@ describe("devtoolsPanel", () => {
             it("posts defaults for get state", async () => {
                 (context.workspaceState.get as jest.Mock).mockReturnValue(null);
 
-                const dtp = await import("./devtoolsPanel");
+                const dtp = await import("../src/devtoolsPanel");
                 dtp.DevToolsPanel.createOrShow(context, mockTelemetry, "", mockRuntimeConfig);
 
                 const expectedId = { id: 0 };
@@ -345,7 +345,7 @@ describe("devtoolsPanel", () => {
                     key1: "value1",
                 });
 
-                const dtp = await import("./devtoolsPanel");
+                const dtp = await import("../src/devtoolsPanel");
                 dtp.DevToolsPanel.createOrShow(context, mockTelemetry, "", mockRuntimeConfig);
 
                 hookedEvents.get("setState")!(JSON.stringify({
@@ -361,7 +361,7 @@ describe("devtoolsPanel", () => {
                 };
                 (context.workspaceState.get as jest.Mock).mockReturnValue(null);
 
-                const dtp = await import("./devtoolsPanel");
+                const dtp = await import("../src/devtoolsPanel");
                 dtp.DevToolsPanel.createOrShow(context, mockTelemetry, "", mockRuntimeConfig);
 
                 hookedEvents.get("setState")!(JSON.stringify({
@@ -381,9 +381,9 @@ describe("devtoolsPanel", () => {
                 const mockUtils = {
                     fetchUri: jest.fn().mockResolvedValue(expectedContent),
                 };
-                jest.doMock("./utils", () => mockUtils);
+                jest.doMock("../src/utils", () => mockUtils);
 
-                const dtp = await import("./devtoolsPanel");
+                const dtp = await import("../src/devtoolsPanel");
                 dtp.DevToolsPanel.createOrShow(context, mockTelemetry, "", mockRuntimeConfig);
 
                 await hookedEvents.get("getUrl")!(JSON.stringify(expectedRequest));
@@ -411,9 +411,9 @@ describe("devtoolsPanel", () => {
                 const mockUtils = {
                     fetchUri: jest.fn().mockRejectedValue(null),
                 };
-                jest.doMock("./utils", () => mockUtils);
+                jest.doMock("../src/utils", () => mockUtils);
 
-                const dtp = await import("./devtoolsPanel");
+                const dtp = await import("../src/devtoolsPanel");
                 dtp.DevToolsPanel.createOrShow(context, mockTelemetry, "", mockRuntimeConfig);
 
                 await hookedEvents.get("getUrl")!(JSON.stringify(expectedRequest));
@@ -433,7 +433,7 @@ describe("devtoolsPanel", () => {
                     url: "http://fake.com/app.js",
                 };
 
-                const dtp = await import("./devtoolsPanel");
+                const dtp = await import("../src/devtoolsPanel");
                 dtp.DevToolsPanel.createOrShow(context, mockTelemetry, "", mockRuntimeConfig);
 
                 await hookedEvents.get("openInEditor")!(JSON.stringify(expectedRequest));
@@ -458,9 +458,9 @@ describe("devtoolsPanel", () => {
                     applyPathMapping: jest.fn().mockImplementation((x) => x),
                     fetchUri: jest.fn().mockRejectedValue(null),
                 };
-                jest.doMock("./utils", () => mockUtils);
+                jest.doMock("../src/utils", () => mockUtils);
 
-                const dtp = await import("./devtoolsPanel");
+                const dtp = await import("../src/devtoolsPanel");
                 dtp.DevToolsPanel.createOrShow(context, mockTelemetry, "", mockRuntimeConfig);
 
                 await hookedEvents.get("openInEditor")!(JSON.stringify(expectedRequest));
@@ -472,7 +472,7 @@ describe("devtoolsPanel", () => {
                 const expectedState = { enableNetwork: true, themeString: "System preference", whatsNew: true};
                 (context.workspaceState.get as jest.Mock).mockReturnValue(expectedState);
 
-                const dtp = await import("./devtoolsPanel");
+                const dtp = await import("../src/devtoolsPanel");
                 dtp.DevToolsPanel.createOrShow(context, mockTelemetry, "", mockRuntimeConfig);
 
                 hookedEvents.get("getVscodeSettings")!(JSON.stringify(expectedId));
@@ -510,9 +510,9 @@ describe("devtoolsPanel", () => {
                     applyPathMapping: jest.fn().mockImplementation((x) => x),
                     fetchUri: jest.fn().mockRejectedValue(null),
                 };
-                jest.doMock("./utils", () => mockUtils);
+                jest.doMock("../src/utils", () => mockUtils);
 
-                const dtp = await import("./devtoolsPanel");
+                const dtp = await import("../src/devtoolsPanel");
                 dtp.DevToolsPanel.createOrShow(context, mockTelemetry, "", mockRuntimeConfig);
 
                 await hookedEvents.get("openInEditor")!(JSON.stringify(expectedRequest));
diff --git a/src/extension.test.ts b/test/extension.test.ts
similarity index 87%
rename from src/extension.test.ts
rename to test/extension.test.ts
index d1c83ad..0a5c0ff 100644
--- a/src/extension.test.ts
+++ b/test/extension.test.ts
@@ -3,14 +3,14 @@
 
 import { ExtensionContext } from "vscode";
 import TelemetryReporter from "vscode-extension-telemetry";
-import { createFakeExtensionContext, createFakeTelemetryReporter, createFakeVSCode, Mocked } from "./test/helpers";
+import { createFakeExtensionContext, createFakeTelemetryReporter, createFakeVSCode, Mocked } from "./helpers/helpers";
 import {
     IRemoteTargetJson,
     IRuntimeConfig,
     removeTrailingSlash,
     SETTINGS_STORE_NAME,
     SETTINGS_VIEW_NAME,
-} from "./utils";
+} from "../src/utils";
 
 jest.mock("vscode", () => createFakeVSCode(), { virtual: true });
 
@@ -20,7 +20,7 @@ describe("extension", () => {
     describe("activate", () => {
         let context: ExtensionContext;
         let commandMock: jest.Mock;
-        let mockUtils: Partial<Mocked<typeof import("./utils")>>;
+        let mockUtils: Partial<Mocked<typeof import("../src/utils")>>;
         let mockRegisterTree: jest.Mock;
         let mockProviderRefresh: jest.Mock;
         let mockProviderConstructor: jest.Mock;
@@ -41,12 +41,12 @@ describe("extension", () => {
                 removeTrailingSlash: jest.fn(removeTrailingSlash),
                 getLaunchJson: jest.fn(),
             };
-            jest.doMock("./utils", () => mockUtils);
-            jest.doMock("./launchDebugProvider");
+            jest.doMock("../src/utils", () => mockUtils);
+            jest.doMock("../src/launchDebugProvider");
 
             mockProviderRefresh = jest.fn();
             mockProviderConstructor = jest.fn(() => ({refresh: mockProviderRefresh}));
-            jest.doMock("./cdpTargetsProvider", () => {
+            jest.doMock("../src/cdpTargetsProvider", () => {
                 return {
                     CDPTargetsProvider: mockProviderConstructor,
                 };
@@ -62,7 +62,7 @@ describe("extension", () => {
         });
 
         it("creates a telemetry reporter", async () => {
-            const newExtension = await import("./extension");
+            const newExtension = await import("../src/extension");
 
             // Activation should create a new reporter
             newExtension.activate(context);
@@ -70,7 +70,7 @@ describe("extension", () => {
         });
 
         it("registers commands correctly", async () => {
-            const newExtension = await import("./extension");
+            const newExtension = await import("../src/extension");
 
             // Activation should add the commands as subscriptions on the context
             newExtension.activate(context);
@@ -113,7 +113,7 @@ describe("extension", () => {
             });
 
             // Activate the extension
-            const newExtension = await import("./extension");
+            const newExtension = await import("../src/extension");
             newExtension.activate(context);
             expect(attachCommand).toBeDefined();
 
@@ -133,14 +133,14 @@ describe("extension", () => {
 
         it("performs registered commands correctly", async () => {
             const mockPanelShow = jest.fn();
-            jest.doMock("./devtoolsPanel", () => ({
+            jest.doMock("../src/devtoolsPanel", () => ({
                 DevToolsPanel: {
                     createOrShow: mockPanelShow,
                 },
             }));
             jest.resetModules();
 
-            const newExtension = await import("./extension");
+            const newExtension = await import("../src/extension");
             newExtension.activate(context);
 
             function getCommandCallback(index: number) {
@@ -165,7 +165,7 @@ describe("extension", () => {
         let target: any;
         let mocks: {
             panel: any,
-            utils: Partial<Mocked<typeof import("./utils")>>,
+            utils: Partial<Mocked<typeof import("../src/utils")>>,
             vscode: any,
         };
         let mockTelemetry: Mocked<Readonly<TelemetryReporter>>;
@@ -202,13 +202,13 @@ describe("extension", () => {
             };
 
             jest.doMock("vscode", () => mocks.vscode, { virtual: true });
-            jest.doMock("./devtoolsPanel", () => mocks.panel);
-            jest.doMock("./utils", () => mocks.utils);
+            jest.doMock("../src/devtoolsPanel", () => mocks.panel);
+            jest.doMock("../src/utils", () => mocks.utils);
             jest.resetModules();
         });
 
         it("creates a telemetry reporter", async () => {
-            const newExtension = await import("./extension");
+            const newExtension = await import("../src/extension");
 
             // Activation should create a new reporter
             await newExtension.attach(createFakeExtensionContext());
@@ -216,7 +216,7 @@ describe("extension", () => {
         });
 
         it("uses user config", async () => {
-            const newExtension = await import("./extension");
+            const newExtension = await import("../src/extension");
 
             // Activation should create a new reporter
             const config = {
@@ -236,13 +236,13 @@ describe("extension", () => {
 
             mocks.utils.getListOfTargets!.mockResolvedValueOnce(allTargets);
 
-            const newExtension = await import("./extension");
+            const newExtension = await import("../src/extension");
             await newExtension.attach(createFakeExtensionContext());
             expect(mocks.utils.fixRemoteWebSocket).toBeCalledTimes(expectedCount);
         });
 
         it("shows quick pick window if no target", async () => {
-            const newExtension = await import("./extension");
+            const newExtension = await import("../src/extension");
             await newExtension.attach(createFakeExtensionContext());
             expect(mocks.vscode.window.showQuickPick).toBeCalledTimes(1);
         });
@@ -254,7 +254,7 @@ describe("extension", () => {
             mocks.vscode.window.showQuickPick.mockResolvedValueOnce(expectedPick);
 
             const expectedContext = createFakeExtensionContext();
-            const newExtension = await import("./extension");
+            const newExtension = await import("../src/extension");
             await newExtension.attach(expectedContext);
             expect(mocks.panel.DevToolsPanel.createOrShow).toHaveBeenCalledWith(
                 expectedContext,
@@ -277,7 +277,7 @@ describe("extension", () => {
             mocks.utils.fixRemoteWebSocket!.mockReturnValueOnce(target);
 
             const expectedContext = createFakeExtensionContext();
-            const newExtension = await import("./extension");
+            const newExtension = await import("../src/extension");
             await newExtension.attach(expectedContext, expectedUrl);
             expect(mocks.panel.DevToolsPanel.createOrShow).toHaveBeenCalledWith(
                 expectedContext,
@@ -300,7 +300,7 @@ describe("extension", () => {
             mocks.utils.fixRemoteWebSocket!.mockReturnValueOnce(target);
 
             const expectedContext = createFakeExtensionContext();
-            const newExtension = await import("./extension");
+            const newExtension = await import("../src/extension");
             await newExtension.attach(expectedContext, expectedUrl);
             expect(mocks.panel.DevToolsPanel.createOrShow).toHaveBeenCalledWith(
                 expectedContext,
@@ -333,7 +333,7 @@ describe("extension", () => {
             mocks.utils.fixRemoteWebSocket!.mockReturnValueOnce(target);
 
             const expectedContext = createFakeExtensionContext();
-            const newExtension = await import("./extension");
+            const newExtension = await import("../src/extension");
             await newExtension.attach(expectedContext, "http://*");
             expect(mocks.panel.DevToolsPanel.createOrShow).toHaveBeenCalledWith(
                 expectedContext,
@@ -346,7 +346,7 @@ describe("extension", () => {
         it("shows error if it can't find given target", async () => {
             const expectedMissingUrl = "some non-existent target";
 
-            const newExtension = await import("./extension");
+            const newExtension = await import("../src/extension");
             await newExtension.attach(createFakeExtensionContext(), expectedMissingUrl);
             expect(mocks.vscode.window.showErrorMessage).toBeCalledWith(expect.stringContaining(expectedMissingUrl));
         });
@@ -355,7 +355,7 @@ describe("extension", () => {
             const expectedUrl = target.url;
             delete target.url;
 
-            const newExtension = await import("./extension");
+            const newExtension = await import("../src/extension");
             await newExtension.attach(createFakeExtensionContext(), expectedUrl);
             expect(mocks.vscode.window.showErrorMessage).toBeCalledWith(expect.stringContaining(expectedUrl));
         });
@@ -363,7 +363,7 @@ describe("extension", () => {
         it("reports telemetry if failed to get targets", async () => {
             mocks.utils.getListOfTargets!.mockResolvedValueOnce(null as any);
 
-            const newExtension = await import("./extension");
+            const newExtension = await import("../src/extension");
             await newExtension.attach(createFakeExtensionContext());
             expect(mockTelemetry.sendTelemetryEvent).toHaveBeenCalled();
         });
@@ -372,8 +372,8 @@ describe("extension", () => {
     describe("launch", () => {
         const fakeBrowser = {addListener: () => null};
         let mockReporter: Mocked<Readonly<TelemetryReporter>>;
-        let mockUtils: Partial<Mocked<typeof import("./utils")>>;
-        let mockPanel: Partial<Mocked<typeof import("./devtoolsPanel")>>;
+        let mockUtils: Partial<Mocked<typeof import("../src/utils")>>;
+        let mockPanel: Partial<Mocked<typeof import("../src/devtoolsPanel")>>;
 
         beforeEach(() => {
             mockReporter = createFakeTelemetryReporter();
@@ -402,8 +402,8 @@ describe("extension", () => {
             };
 
             jest.doMock("vscode", () => createFakeVSCode(), { virtual: true });
-            jest.doMock("./utils", () => mockUtils);
-            jest.doMock("./devtoolsPanel", () => mockPanel);
+            jest.doMock("../src/utils", () => mockUtils);
+            jest.doMock("../src/devtoolsPanel", () => mockPanel);
             jest.resetModules();
         });
 
@@ -412,7 +412,7 @@ describe("extension", () => {
             const context = createFakeExtensionContext();
 
             // Activate the extension
-            const newExtension = await import("./extension");
+            const newExtension = await import("../src/extension");
             newExtension.activate(context);
 
             // Get the launch command that was added by extension activation
@@ -428,7 +428,7 @@ describe("extension", () => {
             const context = createFakeExtensionContext();
 
             // Activate the extension
-            const newExtension = await import("./extension");
+            const newExtension = await import("../src/extension");
             newExtension.activate(context);
 
             // Get the launch command that was added by extension activation
@@ -444,7 +444,7 @@ describe("extension", () => {
                 webSocketDebuggerUrl: "ws://localhost:9222",
             };
             mockUtils.openNewTab!.mockResolvedValueOnce(target as any);
-            const newExtension = await import("./extension");
+            const newExtension = await import("../src/extension");
 
             // Activation should create a new reporter
             await newExtension.launch(createFakeExtensionContext());
@@ -452,7 +452,7 @@ describe("extension", () => {
         });
 
         it("uses user config", async () => {
-            const newExtension = await import("./extension");
+            const newExtension = await import("../src/extension");
 
             // Activation should create a new reporter
             const config = {
@@ -468,7 +468,7 @@ describe("extension", () => {
                 webSocketDebuggerUrl: "ws://localhost:9222",
             };
             mockUtils.openNewTab!.mockResolvedValueOnce(target as any);
-            const newExtension = await import("./extension");
+            const newExtension = await import("../src/extension");
 
             await newExtension.launch(createFakeExtensionContext());
             expect(mockPanel.DevToolsPanel!.createOrShow).toHaveBeenCalledWith(
@@ -483,7 +483,7 @@ describe("extension", () => {
             mockUtils.getBrowserPath!.mockResolvedValueOnce("");
 
             const vscode = jest.requireMock("vscode");
-            const newExtension = await import("./extension");
+            const newExtension = await import("../src/extension");
 
             const result = await newExtension.launch(createFakeExtensionContext());
             expect(result).toBeUndefined();
@@ -496,7 +496,7 @@ describe("extension", () => {
             };
             mockUtils.openNewTab!.mockResolvedValueOnce(undefined);
             mockUtils.openNewTab!.mockResolvedValueOnce(target as any);
-            const newExtension = await import("./extension");
+            const newExtension = await import("../src/extension");
 
             await newExtension.launch(createFakeExtensionContext());
             expect(mockUtils.launchBrowser).toHaveBeenCalled();
@@ -504,7 +504,7 @@ describe("extension", () => {
 
         it("reports the browser type", async () => {
             mockUtils.openNewTab!.mockResolvedValue(undefined);
-            const newExtension = await import("./extension");
+            const newExtension = await import("../src/extension");
 
             const tests = [
                 { path: "some\\path\\to\\edge.exe -port", exe: "edge" },
diff --git a/src/test/helpers.ts b/test/helpers/helpers.ts
similarity index 100%
rename from src/test/helpers.ts
rename to test/helpers/helpers.ts
diff --git a/src/host/host.test.ts b/test/host/host.test.ts
similarity index 85%
rename from src/host/host.test.ts
rename to test/host/host.test.ts
index 0485c28..2700cd4 100644
--- a/src/host/host.test.ts
+++ b/test/host/host.test.ts
@@ -1,8 +1,8 @@
 // Copyright (c) Microsoft Corporation. All rights reserved.
 // Licensed under the MIT License.
 
-import { getFirstCallback, Mocked } from "../test/helpers";
-import { IDevToolsWindow } from "./host";
+import { getFirstCallback, Mocked } from "../helpers/helpers";
+import { IDevToolsWindow } from "../../src/host/host";
 
 describe("host", () => {
     let mockGlobal: Mocked<IDevToolsWindow>;
@@ -19,7 +19,7 @@ describe("host", () => {
 
     describe("initialize", () => {
         it("hooks events correctly", async () => {
-            const host = await import("./host");
+            const host = await import("../../src/host/host");
             host.initialize(mockGlobal);
 
             expect(mockGlobal.addEventListener).toHaveBeenNthCalledWith(1, "message", expect.any(Function), true);
@@ -30,7 +30,7 @@ describe("host", () => {
         });
 
         it("skips events if there is no contentWindow", async () => {
-            const host = await import("./host");
+            const host = await import("../../src/host/host");
             host.initialize(null as any as IDevToolsWindow);
 
             expect(mockGlobal.addEventListener).not.toHaveBeenCalled();
@@ -39,7 +39,7 @@ describe("host", () => {
         });
 
         it("hides local storage", async () => {
-            const host = await import("./host");
+            const host = await import("../../src/host/host");
             host.initialize(mockGlobal);
 
             expect(mockGlobal.localStorage).toBeUndefined();
@@ -51,7 +51,7 @@ describe("host", () => {
         });
 
         it("emulates session storage", async () => {
-            const host = await import("./host");
+            const host = await import("../../src/host/host");
             host.initialize(mockGlobal);
 
             expect(mockGlobal.sessionStorage).toBeDefined();
@@ -66,14 +66,14 @@ describe("host", () => {
     describe("DOMContentLoaded", () => {
         it("sets resource loader", async () => {
             const mockOverride = jest.fn();
-            jest.doMock("./toolsResourceLoader", () => ({
+            jest.doMock("../../src/host/toolsResourceLoader", () => ({
                 ToolsResourceLoader: {
                     overrideResourceLoading: mockOverride,
                 },
             }));
             jest.resetModules();
 
-            const host = await import("./host");
+            const host = await import("../../src/host/host");
             host.initialize(mockGlobal);
 
             mockGlobal.importScriptPathPrefix = "null/somepath";
@@ -97,8 +97,8 @@ describe("host", () => {
             const mockWebviewEvents = {
                 parseMessageFromChannel: jest.fn(),
             };
-            jest.doMock("../common/webviewEvents", () => mockWebviewEvents);
-            jest.doMock("./toolsHost", () => ({
+            jest.doMock("../../src/common/webviewEvents", () => mockWebviewEvents);
+            jest.doMock("../../src/host/toolsHost", () => ({
                 ToolsHost: function toolsHost() {
                     return {
                         onMessageFromChannel: jest.fn(),
@@ -106,7 +106,7 @@ describe("host", () => {
             }}));
             jest.resetModules();
 
-            const host = await import("./host");
+            const host = await import("../../src/host/host");
             host.initialize(mockGlobal);
 
             const onMessage = getFirstCallback(mockGlobal.addEventListener, 1);
diff --git a/src/host/mainHost.test.ts b/test/host/mainHost.test.ts
similarity index 66%
rename from src/host/mainHost.test.ts
rename to test/host/mainHost.test.ts
index 2ebccd8..2ead3d2 100644
--- a/src/host/mainHost.test.ts
+++ b/test/host/mainHost.test.ts
@@ -4,9 +4,9 @@
 describe("mainHost", () => {
     it("calls initialize", async () => {
         const mockInitialize = jest.fn();
-        jest.doMock("./host", () => ({ initialize: mockInitialize }));
+        jest.doMock("../../src/host/host", () => ({ initialize: mockInitialize }));
 
-        const mainHost = await import("./mainHost");
+        const mainHost = await import("../../src/host/mainHost");
         expect(mainHost).toBeDefined();
         expect(mockInitialize).toBeCalledWith(global);
     });
diff --git a/src/host/polyfills/cssPaddingInline.test.ts b/test/host/polyfills/cssPaddingInline.test.ts
similarity index 86%
rename from src/host/polyfills/cssPaddingInline.test.ts
rename to test/host/polyfills/cssPaddingInline.test.ts
index d129efa..c49f3d9 100644
--- a/src/host/polyfills/cssPaddingInline.test.ts
+++ b/test/host/polyfills/cssPaddingInline.test.ts
@@ -1,7 +1,7 @@
 // Copyright (c) Microsoft Corporation. All rights reserved.
 // Licensed under the MIT License.
-import { testPatch } from "../../test/helpers";
-import { applyPaddingInlineCssPatch } from "./cssPaddingInline";
+import { testPatch } from "../../helpers/helpers";
+import { applyPaddingInlineCssPatch } from "../../../src/host/polyfills/cssPaddingInline";
 
 describe("cssPaddingInline", () => {
     it("applyPaddingInlineCssPatch correctly changes elements-disclosure text", async () => {
diff --git a/src/host/polyfills/releaseNote.test.ts b/test/host/polyfills/releaseNote.test.ts
similarity index 90%
rename from src/host/polyfills/releaseNote.test.ts
rename to test/host/polyfills/releaseNote.test.ts
index cb96925..310ec27 100644
--- a/src/host/polyfills/releaseNote.test.ts
+++ b/test/host/polyfills/releaseNote.test.ts
@@ -1,8 +1,8 @@
 // Copyright (c) Microsoft Corporation. All rights reserved.
 // Licensed under the MIT License.
 
-import { getTextFromFile } from "../../test/helpers";
-import * as ReleaseNotePatch from "./releaseNote";
+import { getTextFromFile } from "../../helpers/helpers";
+import * as ReleaseNotePatch from "../../../src/host/polyfills/releaseNote";
 
 describe("Release notes text replacement", () => {
     it("verifies that applyReleaseNotePatch correctly replaces what's new content", async () => {
diff --git a/src/host/polyfills/runtime.test.ts b/test/host/polyfills/runtime.test.ts
similarity index 82%
rename from src/host/polyfills/runtime.test.ts
rename to test/host/polyfills/runtime.test.ts
index a9b1295..fcfe870 100644
--- a/src/host/polyfills/runtime.test.ts
+++ b/test/host/polyfills/runtime.test.ts
@@ -1,7 +1,7 @@
 // Copyright (c) Microsoft Corporation. All rights reserved.
 // Licensed under the MIT License.
-import { testPatch } from "../../test/helpers";
-import { applyRuntimeImportScriptPathPrefixPatch } from "./runtime";
+import { testPatch } from "../../helpers/helpers";
+import { applyRuntimeImportScriptPathPrefixPatch } from "../../../src/host/polyfills/runtime";
 
 describe("importScriptPathPrefix replacement", () => {
     it("verifies that importScriptPathPrefix is exposed as a module variable", async () => {
diff --git a/src/host/polyfills/simpleView.test.ts b/test/host/polyfills/simpleView.test.ts
similarity index 96%
rename from src/host/polyfills/simpleView.test.ts
rename to test/host/polyfills/simpleView.test.ts
index 1b89223..aeba5f7 100644
--- a/src/host/polyfills/simpleView.test.ts
+++ b/test/host/polyfills/simpleView.test.ts
@@ -1,7 +1,7 @@
 // Copyright (c) Microsoft Corporation. All rights reserved.
 // Licensed under the MIT License.
-import { testPatch } from "../../test/helpers";
-import * as SimpleView from "./simpleView"
+import { testPatch } from "../../helpers/helpers";
+import * as SimpleView from "../../../src/host/polyfills/simpleView"
 
 describe("simpleView", () => {
     it("revealInVSCode calls openInEditor", async () => {
diff --git a/src/host/polyfills/textSelection.test.ts b/test/host/polyfills/textSelection.test.ts
similarity index 80%
rename from src/host/polyfills/textSelection.test.ts
rename to test/host/polyfills/textSelection.test.ts
index 61487d3..9b1ff17 100644
--- a/src/host/polyfills/textSelection.test.ts
+++ b/test/host/polyfills/textSelection.test.ts
@@ -1,7 +1,7 @@
 // Copyright (c) Microsoft Corporation. All rights reserved.
 // Licensed under the MIT License.
-import { testPatch } from "../../test/helpers";
-import { applySetupTextSelectionPatch } from "./textSelection";
+import { testPatch } from "../../helpers/helpers";
+import { applySetupTextSelectionPatch } from "../../../src/host/polyfills/textSelection";
 
 describe("textSelection", () => {
     it("applySetupTextSelectionPatch correctly changes text", async () => {
diff --git a/src/host/polyfills/thirdPartyI18n.test.ts b/test/host/polyfills/thirdPartyI18n.test.ts
similarity index 73%
rename from src/host/polyfills/thirdPartyI18n.test.ts
rename to test/host/polyfills/thirdPartyI18n.test.ts
index 9db84e0..de2ff25 100644
--- a/src/host/polyfills/thirdPartyI18n.test.ts
+++ b/test/host/polyfills/thirdPartyI18n.test.ts
@@ -1,7 +1,7 @@
 // Copyright (c) Microsoft Corporation. All rights reserved.
 // Licensed under the MIT License.
-import { testPatch } from "../../test/helpers";
-import { applyThirdPartyI18nLocalesPatch } from "./thirdPartyI18n";
+import { testPatch } from "../../helpers/helpers";
+import { applyThirdPartyI18nLocalesPatch } from "../../../src/host/polyfills/thirdPartyI18n";
 
 describe("override i18n locales", () => {
     it("applyThirdPartyI18nLocalesPatch correctly changes text", async () => {
diff --git a/src/host/toolsHost.test.ts b/test/host/toolsHost.test.ts
similarity index 88%
rename from src/host/toolsHost.test.ts
rename to test/host/toolsHost.test.ts
index ef8fb54..495154e 100644
--- a/src/host/toolsHost.test.ts
+++ b/test/host/toolsHost.test.ts
@@ -1,8 +1,8 @@
 // Copyright (c) Microsoft Corporation. All rights reserved.
 // Licensed under the MIT License.
 
-import { getFirstCallback, Mocked } from "../test/helpers";
-import { ToolsResourceLoader } from "./toolsResourceLoader";
+import { getFirstCallback, Mocked } from "../helpers/helpers";
+import { ToolsResourceLoader } from "../../src/host/toolsResourceLoader";
 
 describe("toolsHost", () => {
     let mockResourceLoader: Mocked<ToolsResourceLoader>;
@@ -22,14 +22,14 @@ describe("toolsHost", () => {
               postMessage: jest.fn(),
           },
       };
-        jest.doMock("../common/webviewEvents", () => mockWebviewEvents);
-        jest.doMock("./host", () => mockHost);
+        jest.doMock("../../src/common/webviewEvents", () => mockWebviewEvents);
+        jest.doMock("../../src/host/host", () => mockHost);
         jest.resetModules();
     });
 
     describe("isHostedMode", () => {
         it("returns true", async () => {
-            const th = await import("./toolsHost");
+            const th = await import("../../src/host/toolsHost");
             const host = new th.ToolsHost();
 
             expect(host.isHostedMode()).toEqual(true);
@@ -38,7 +38,7 @@ describe("toolsHost", () => {
 
     describe("getPreferences", () => {
         it("calls across to webview", async () => {
-            const th = await import("./toolsHost");
+            const th = await import("../../src/host/toolsHost");
             const host = new th.ToolsHost();
 
             const mockCallback = jest.fn();
@@ -58,7 +58,7 @@ describe("toolsHost", () => {
         });
 
         it("fires callbacks on response from extension", async () => {
-            const th = await import("./toolsHost");
+            const th = await import("../../src/host/toolsHost");
             const host = new th.ToolsHost();
 
             const mockCallback = jest.fn();
@@ -81,7 +81,7 @@ describe("toolsHost", () => {
 
     describe("setPreferences", () => {
         it("calls across to webview", async () => {
-            const th = await import("./toolsHost");
+            const th = await import("../../src/host/toolsHost");
             const host = new th.ToolsHost();
 
             const expectedPref = {
@@ -106,7 +106,7 @@ describe("toolsHost", () => {
 
     describe("recordEnumeratedHistogram", () => {
         it("calls across to extension", async () => {
-            const th = await import("./toolsHost");
+            const th = await import("../../src/host/toolsHost");
             const host = new th.ToolsHost();
 
             const expectedTelemetry = {
@@ -132,7 +132,7 @@ describe("toolsHost", () => {
 
     describe("recordPerformanceHistogram", () => {
         it("calls across to extension", async () => {
-            const th = await import("./toolsHost");
+            const th = await import("../../src/host/toolsHost");
             const host = new th.ToolsHost();
 
             const expectedTelemetry = {
@@ -158,7 +158,7 @@ describe("toolsHost", () => {
 
     describe("reportError", () => {
         it("calls across to extension", async () => {
-            const th = await import("./toolsHost");
+            const th = await import("../../src/host/toolsHost");
             const host = new th.ToolsHost();
 
             const expectedTelemetry = {
@@ -198,7 +198,7 @@ describe("toolsHost", () => {
 
     describe("openInEditor", () => {
         it("calls across to extension", async () => {
-            const th = await import("./toolsHost");
+            const th = await import("../../src/host/toolsHost");
             const host = new th.ToolsHost();
 
             const expectedRequest = {
@@ -229,7 +229,7 @@ describe("toolsHost", () => {
 
     describe("onMessageFromChannel", () => {
         it("calls onResolvedUrlFromChannel on getUrl message", async () => {
-            const th = await import("./toolsHost");
+            const th = await import("../../src/host/toolsHost");
             const host = new th.ToolsHost();
             host.setResourceLoader(mockResourceLoader);
 
@@ -250,9 +250,9 @@ describe("toolsHost", () => {
                     },
                 },
             };
-            jest.doMock("./toolsWebSocket", () => mockToolsWS);
+            jest.doMock("../../src/host/toolsWebSocket", () => mockToolsWS);
 
-            const th = await import("./toolsHost");
+            const th = await import("../../src/host/toolsHost");
             const host = new th.ToolsHost();
 
             const expectedArgs = { event: "message", message: "some websocket message" };
diff --git a/src/host/toolsResourceLoader.test.ts b/test/host/toolsResourceLoader.test.ts
similarity index 86%
rename from src/host/toolsResourceLoader.test.ts
rename to test/host/toolsResourceLoader.test.ts
index efb7e28..2504762 100644
--- a/src/host/toolsResourceLoader.test.ts
+++ b/test/host/toolsResourceLoader.test.ts
@@ -1,8 +1,8 @@
 // Copyright (c) Microsoft Corporation. All rights reserved.
 // Licensed under the MIT License.
 
-import { getFirstCallback, Mocked } from "../test/helpers";
-import { IRuntimeResourceLoader } from "./toolsResourceLoader";
+import { getFirstCallback, Mocked } from "../helpers/helpers";
+import { IRuntimeResourceLoader } from "../../src/host/toolsResourceLoader";
 
 describe("toolsResourceLoader", () => {
     let mockLoader: Mocked<IRuntimeResourceLoader>;
@@ -24,8 +24,8 @@ describe("toolsResourceLoader", () => {
           },
         };
 
-        jest.doMock("./host", () => mockHost);
-        jest.doMock("../common/webviewEvents", () => mockWebviewEvents);
+        jest.doMock("../../src/host/host", () => mockHost);
+        jest.doMock("../../src/common/webviewEvents", () => mockWebviewEvents);
         jest.resetModules();
     });
 
@@ -33,7 +33,7 @@ describe("toolsResourceLoader", () => {
         it("overrides load resource promise correctly", async () => {
             const originalLoader = mockLoader.loadResourcePromise;
 
-            const trl = await import("./toolsResourceLoader");
+            const trl = await import("../../src/host/toolsResourceLoader");
             const resourceLoader = trl.ToolsResourceLoader.overrideResourceLoading(mockLoader);
 
             expect(resourceLoader).toBeDefined();
@@ -43,7 +43,7 @@ describe("toolsResourceLoader", () => {
 
     describe("loadResource", () => {
         it("uses channel to request http url", async () => {
-            const trl = await import("./toolsResourceLoader");
+            const trl = await import("../../src/host/toolsResourceLoader");
             const resourceLoader = trl.ToolsResourceLoader.overrideResourceLoading(mockLoader);
 
             const expectedUrl = "http://file.url";
@@ -69,7 +69,7 @@ describe("toolsResourceLoader", () => {
         });
 
         it("uses channel to request https url", async () => {
-            const trl = await import("./toolsResourceLoader");
+            const trl = await import("../../src/host/toolsResourceLoader");
             const resourceLoader = trl.ToolsResourceLoader.overrideResourceLoading(mockLoader);
 
             const expectedUrl = "https://file.url";
@@ -97,7 +97,7 @@ describe("toolsResourceLoader", () => {
         it("uses real loader for packaged files", async () => {
             const originalLoader = mockLoader.loadResourcePromise;
 
-            const trl = await import("./toolsResourceLoader");
+            const trl = await import("../../src/host/toolsResourceLoader");
             const resourceLoader = trl.ToolsResourceLoader.overrideResourceLoading(mockLoader);
             expect(resourceLoader).toBeDefined();
 
diff --git a/src/host/toolsWebSocket.test.ts b/test/host/toolsWebSocket.test.ts
similarity index 84%
rename from src/host/toolsWebSocket.test.ts
rename to test/host/toolsWebSocket.test.ts
index 3acb77d..b422a77 100644
--- a/src/host/toolsWebSocket.test.ts
+++ b/test/host/toolsWebSocket.test.ts
@@ -1,7 +1,7 @@
 // Copyright (c) Microsoft Corporation. All rights reserved.
 // Licensed under the MIT License.
 
-import { getFirstCallback } from "../test/helpers";
+import { getFirstCallback } from "../helpers/helpers";
 
 describe("toolsWebSocket", () => {
     let mockWebviewEvents: { encodeMessageForChannel: jest.Mock };
@@ -16,14 +16,14 @@ describe("toolsWebSocket", () => {
               postMessage: jest.fn(),
           },
         };
-        jest.doMock("./host", () => mockHost);
-        jest.doMock("../common/webviewEvents", () => mockWebviewEvents);
+        jest.doMock("../../src/host/host", () => mockHost);
+        jest.doMock("../../src/common/webviewEvents", () => mockWebviewEvents);
         jest.resetModules();
     });
 
     describe("constructor", () => {
         it("updates instance property", async () => {
-            const tws = await import("./toolsWebSocket");
+            const tws = await import("../../src/host/toolsWebSocket");
 
             const websocket = new tws.ToolsWebSocket("some url");
             expect(tws.ToolsWebSocket.instance).toEqual(websocket);
@@ -33,7 +33,7 @@ describe("toolsWebSocket", () => {
         });
 
         it("sends ready event", async () => {
-            const tws = await import("./toolsWebSocket");
+            const tws = await import("../../src/host/toolsWebSocket");
             const websocket = new tws.ToolsWebSocket("some url");
             expect(websocket).toBeDefined();
 
@@ -51,7 +51,7 @@ describe("toolsWebSocket", () => {
 
     describe("send", () => {
         it("forwards messages correctly", async () => {
-            const tws = await import("./toolsWebSocket");
+            const tws = await import("../../src/host/toolsWebSocket");
             const websocket = new tws.ToolsWebSocket("some url");
             mockWebviewEvents.encodeMessageForChannel.mockClear();
 
@@ -72,7 +72,7 @@ describe("toolsWebSocket", () => {
 
     describe("onMessageFromChannel", () => {
         it("parses control messages and calls correct handlers", async () => {
-            const tws = await import("./toolsWebSocket");
+            const tws = await import("../../src/host/toolsWebSocket");
             const websocket = new tws.ToolsWebSocket("some url");
 
             websocket.onerror = jest.fn();
@@ -89,7 +89,7 @@ describe("toolsWebSocket", () => {
         });
 
         it("forwards websocket messages to onmessage", async () => {
-            const tws = await import("./toolsWebSocket");
+            const tws = await import("../../src/host/toolsWebSocket");
             const websocket = new tws.ToolsWebSocket("some url");
 
             websocket.onmessage = jest.fn();
@@ -104,7 +104,7 @@ describe("toolsWebSocket", () => {
         });
 
         it("ignores websocket messages with no message data", async () => {
-            const tws = await import("./toolsWebSocket");
+            const tws = await import("../../src/host/toolsWebSocket");
             const websocket = new tws.ToolsWebSocket("some url");
 
             websocket.onmessage = jest.fn();
diff --git a/src/launchDebugProvider.test.ts b/test/launchDebugProvider.test.ts
similarity index 93%
rename from src/launchDebugProvider.test.ts
rename to test/launchDebugProvider.test.ts
index 8e45392..f79ebe0 100644
--- a/src/launchDebugProvider.test.ts
+++ b/test/launchDebugProvider.test.ts
@@ -2,14 +2,14 @@
 // Licensed under the MIT License.
 
 import TelemetryReporter from "vscode-extension-telemetry";
-import { LaunchDebugProvider } from "./launchDebugProvider";
+import { LaunchDebugProvider } from "../src/launchDebugProvider";
 import {
     createFakeExtensionContext,
     createFakeTelemetryReporter,
     createFakeVSCode,
     Mocked,
-} from "./test/helpers";
-import { SETTINGS_STORE_NAME } from "./utils";
+} from "./helpers/helpers";
+import { SETTINGS_STORE_NAME } from "../src/utils";
 
 jest.mock("vscode", () => null, { virtual: true });
 
@@ -27,7 +27,7 @@ describe("launchDebugProvider", () => {
         jest.doMock("vscode", () => createFakeVSCode(), { virtual: true });
         jest.resetModules();
 
-        const ldp = await import("./launchDebugProvider");
+        const ldp = await import("../src/launchDebugProvider");
         host = new ldp.LaunchDebugProvider(createFakeExtensionContext(), mockReporter, attach, launch);
     });
 
diff --git a/src/panelSocket.test.ts b/test/panelSocket.test.ts
similarity index 91%
rename from src/panelSocket.test.ts
rename to test/panelSocket.test.ts
index c33a716..944e7bb 100644
--- a/src/panelSocket.test.ts
+++ b/test/panelSocket.test.ts
@@ -2,8 +2,8 @@
 // Licensed under the MIT License.
 
 import WebSocket from "ws";
-import { webviewEventNames } from "./common/webviewEvents";
-import { Mocked } from "./test/helpers";
+import { webviewEventNames } from "../src/common/webviewEvents";
+import { Mocked } from "./helpers/helpers";
 
 describe("panelSocket", () => {
     const readyMessage = "ready:args";
@@ -32,7 +32,7 @@ describe("panelSocket", () => {
             onmessage: mockWebSocket.onmessage,
             onopen: mockWebSocket.onopen,
         };
-        const ps = await import("./panelSocket");
+        const ps = await import("../src/panelSocket");
         const panelSocket = new ps.PanelSocket("", jest.fn());
 
         panelSocket.onMessageFromWebview(`websocket:""`);
@@ -49,7 +49,7 @@ describe("panelSocket", () => {
             onmessage: mockWebSocket.onmessage,
             onopen: mockWebSocket.onopen,
         };
-        const ps = await import("./panelSocket");
+        const ps = await import("../src/panelSocket");
         const panelSocket = new ps.PanelSocket("", jest.fn());
 
         panelSocket.onMessageFromWebview(readyMessage);
@@ -71,7 +71,7 @@ describe("panelSocket", () => {
     });
 
     it("disposes websocket correctly", async () => {
-        const ps = await import("./panelSocket");
+        const ps = await import("../src/panelSocket");
         const panelSocket = new ps.PanelSocket("", jest.fn());
 
         panelSocket.onMessageFromWebview(readyMessage);
@@ -89,7 +89,7 @@ describe("panelSocket", () => {
             "{there}",
             "{world}",
         ];
-        const ps = await import("./panelSocket");
+        const ps = await import("../src/panelSocket");
         const panelSocket = new ps.PanelSocket("", jest.fn());
 
         // Create the websocket
@@ -117,7 +117,7 @@ describe("panelSocket", () => {
     it("posts back messages once connected", async () => {
         const expectedMessage = { data: "hello world" };
         const mockPost = jest.fn();
-        const ps = await import("./panelSocket");
+        const ps = await import("../src/panelSocket");
         const panelSocket = new ps.PanelSocket("", mockPost);
 
         // Create the websocket
@@ -140,7 +140,7 @@ describe("panelSocket", () => {
 
     it("posts back errors once connected", async () => {
         const mockPost = jest.fn();
-        const ps = await import("./panelSocket");
+        const ps = await import("../src/panelSocket");
         const panelSocket = new ps.PanelSocket("", mockPost);
 
         // Create the websocket
@@ -158,7 +158,7 @@ describe("panelSocket", () => {
 
     it("posts back close once connected", async () => {
         const mockPost = jest.fn();
-        const ps = await import("./panelSocket");
+        const ps = await import("../src/panelSocket");
         const panelSocket = new ps.PanelSocket("", mockPost);
 
         // Create the websocket
@@ -179,7 +179,7 @@ describe("panelSocket", () => {
     });
 
     it("emits messages correctly", async () => {
-        const ps = await import("./panelSocket");
+        const ps = await import("../src/panelSocket");
         const panelSocket = new ps.PanelSocket("", jest.fn());
 
         const actualMessages: string[] = [];
diff --git a/src/utils.test.ts b/test/utils.test.ts
similarity index 95%
rename from src/utils.test.ts
rename to test/utils.test.ts
index ecb16ee..9e71c26 100644
--- a/src/utils.test.ts
+++ b/test/utils.test.ts
@@ -6,13 +6,13 @@
 
 import * as path from "path";
 
-import { createFakeExtensionContext, createFakeGet, createFakeVSCode, Mocked } from "./test/helpers";
-import { BrowserFlavor, IRemoteTargetJson, IUserConfig } from "./utils";
+import { createFakeExtensionContext, createFakeGet, createFakeVSCode, Mocked } from "./helpers/helpers";
+import { BrowserFlavor, IRemoteTargetJson, IUserConfig } from "../src/utils";
 
 jest.mock("vscode", () => null, { virtual: true });
 
 describe("utils", () => {
-    let utils: typeof import("./utils");
+    let utils: typeof import("../src/utils");
     let mockGetHttp: jest.Mock;
     let mockGetHttps: jest.Mock;
 
@@ -26,7 +26,7 @@ describe("utils", () => {
         mockGetHttp = jest.requireMock("http").get;
         mockGetHttps = jest.requireMock("https").get;
 
-        utils = await import("./utils");
+        utils = await import("../src/utils");
     });
 
     describe("fixRemoteWebSocket", () => {
@@ -384,10 +384,10 @@ describe("utils", () => {
         const mockReporter = {};
         beforeEach(async () => {
             jest.doMock("../package.json", () => ({}), { virtual: true });
-            jest.doMock("./debugTelemetryReporter", () => ({DebugTelemetryReporter: jest.fn()}));
+            jest.doMock("../src/debugTelemetryReporter", () => ({DebugTelemetryReporter: jest.fn()}));
             jest.resetModules();
 
-            utils = await import("./utils");
+            utils = await import("../src/utils");
         });
 
         it("returns a debug version when no package info in debug env", async () => {
@@ -413,7 +413,7 @@ describe("utils", () => {
             jest.resetModules();
             jest.requireMock("vscode").env.machineId = "12345";
 
-            utils = await import("./utils");
+            utils = await import("../src/utils");
 
             const mockContext = createFakeExtensionContext();
             const reporter = utils.createTelemetryReporter(mockContext);
@@ -426,7 +426,7 @@ describe("utils", () => {
         it("returns the correct platform", async () => {
             jest.doMock("os");
             jest.resetModules();
-            utils = await import("./utils");
+            utils = await import("../src/utils");
 
             const os: Mocked<typeof import("os")> = jest.requireMock("os");
             os.platform.mockReturnValue("darwin");
@@ -451,7 +451,7 @@ describe("utils", () => {
             jest.doMock("fs-extra");
             jest.doMock("os");
             jest.resetModules();
-            utils = await import("./utils");
+            utils = await import("../src/utils");
 
             fse = jest.requireMock("fs-extra");
             os = jest.requireMock("os");
@@ -553,7 +553,7 @@ describe("utils", () => {
         beforeEach(async () => {
             jest.doMock("fs-extra");
             jest.resetModules();
-            utils = await import("./utils");
+            utils = await import("../src/utils");
             fse = jest.requireMock("fs-extra");
         });
 
@@ -577,7 +577,7 @@ describe("utils", () => {
             const vscodeMock = await jest.requireMock("vscode");
             fse.pathExistsSync.mockImplementation(() => true);
             vscodeMock.workspace.getConfiguration.mockImplementation(() => {
-                return { 
+                return {
                     get: (name: string) => [{type: ''}]
                 }
             });
@@ -589,7 +589,7 @@ describe("utils", () => {
             const vscodeMock = await jest.requireMock("vscode");
             fse.pathExistsSync.mockImplementation(() => true);
             vscodeMock.workspace.getConfiguration.mockImplementation(() => {
-                return { 
+                return {
                     get: (name: string) => [{type: 'vscode-edge-devtools.debug'}]
                 }
             });
@@ -604,7 +604,7 @@ describe("utils", () => {
         beforeEach(async () => {
             jest.doMock("fs-extra");
             jest.resetModules();
-            utils = await import("./utils");
+            utils = await import("../src/utils");
 
             fse = jest.requireMock("fs-extra");
             fse.readFileSync.mockImplementation((() => ''));
@@ -615,17 +615,17 @@ describe("utils", () => {
                 update: jest.fn((name: string, value: any) => {}),
             };
             vscodeMock.workspace.getConfiguration.mockImplementation(() => {
-                return { 
+                return {
                         get: jest.fn((name: string) => []),
                         update: vscodeMock.WorkspaceConfiguration.update,
-                    
+
                 }
             });
         });
 
         it('adds a debug config to launch.json', async () => {
             const vscodeMock = await jest.requireMock("vscode");
-            
+
             utils.configureLaunchJson();
             expect(vscodeMock.WorkspaceConfiguration.update).toBeCalledWith('configurations', expect.arrayContaining([expect.any(Object)]));
         });
@@ -652,7 +652,7 @@ describe("utils", () => {
         });
 
         it("spawns the process", async () => {
-            utils = await import("./utils");
+            utils = await import("../src/utils");
             const expectedTempPath = "C:\\someTempPath";
             const os = jest.requireMock("os");
             os.tmpdir.mockReturnValue(expectedTempPath);
@@ -704,7 +704,7 @@ describe("utils", () => {
             const vscodeMock = await jest.requireMock("vscode");
             vscodeMock.workspace.getConfiguration.mockImplementationOnce(() => configMock);
 
-            utils = await import("./utils");
+            utils = await import("../src/utils");
             const expectedTempPath = "C:\\someTempPath";
             const os = jest.requireMock("os");
             os.tmpdir.mockReturnValue(expectedTempPath);
@@ -891,7 +891,7 @@ describe("utils", () => {
         beforeEach(async () => {
             jest.unmock("path");
             jest.resetModules();
-            utils = await import("./utils");
+            utils = await import("../src/utils");
         });
 
         it("removes a matching webpack prefix", () => {