Repository: microsoft/vscode-edge-devtools
Pull request #376 (2021-05-04 20:48:21)

[Launch Config]: Create LaunchConfigManager class to manage launch.json logic
Waiting on: https://github.com/microsoft/vscode-edge-devtools/pull/372


Patch:
diff --git a/src/cdpTargetsProvider.ts b/src/cdpTargetsProvider.ts
index 2dc8102..7b79cae 100644
--- a/src/cdpTargetsProvider.ts
+++ b/src/cdpTargetsProvider.ts
@@ -9,7 +9,7 @@ import { CDPTarget } from './cdpTarget';
 import { fixRemoteWebSocket, getListOfTargets, getRemoteEndpointSettings, IRemoteTargetJson, isLocalResource, SETTINGS_STORE_NAME } from './utils';
 import { IncomingMessage } from 'http';
 import https = require('https');
-import { setLaunchConfig } from './extension';
+import { LaunchConfigManager } from './launchConfigManager';
 
 export class CDPTargetsProvider implements vscode.TreeDataProvider<CDPTarget> {
     readonly onDidChangeTreeData: vscode.Event<CDPTarget | null>;
@@ -92,7 +92,8 @@ export class CDPTargetsProvider implements vscode.TreeDataProvider<CDPTarget> {
     refresh(): void {
         this.telemetryReporter.sendTelemetryEvent('view/refresh');
         this.changeDataEvent.fire(null);
-        setLaunchConfig();
+        void this.clearFaviconResourceDirectory();
+        LaunchConfigManager.instance.updateLaunchConfig();
     }
 
     async clearFaviconResourceDirectory(): Promise<void> {
diff --git a/src/extension.ts b/src/extension.ts
index c08a047..2df2f61 100644
--- a/src/extension.ts
+++ b/src/extension.ts
@@ -17,12 +17,9 @@ import {
     getListOfTargets,
     getRemoteEndpointSettings,
     getRuntimeConfig,
-    getLaunchJson,
-    configureLaunchJson,
     IRemoteTargetJson,
     IUserConfig,
     launchBrowser,
-    LaunchConfig,
     openNewTab,
     SETTINGS_DEFAULT_ATTACH_INTERVAL,
     SETTINGS_DEFAULT_URL,
@@ -32,10 +29,10 @@ import {
     getJsDebugCDPProxyWebsocketUrl,
     reportUrlType,
 } from './utils';
+import { LaunchConfigManager } from './launchConfigManager';
 
 let telemetryReporter: Readonly<TelemetryReporter>;
 let browserInstance: Browser;
-let launchConfig: LaunchConfig;
 let cdpTargetsProvider: CDPTargetsProvider;
 
 
@@ -45,8 +42,7 @@ export function activate(context: vscode.ExtensionContext): void {
     }
 
     // Check if launch.json exists and has supported config to populate side pane welcome message
-    setLaunchConfig();
-
+    LaunchConfigManager.instance.updateLaunchConfig();
     context.subscriptions.push(vscode.commands.registerCommand(`${SETTINGS_STORE_NAME}.attach`, (): void => {
         void attach(context);
     }));
@@ -145,19 +141,17 @@ export function activate(context: vscode.ExtensionContext): void {
         `${SETTINGS_VIEW_NAME}.configureLaunchJson`,
         () => {
             telemetryReporter.sendTelemetryEvent('user/buttonPress', {
-                'VSCode.buttonCode': launchConfig === 'None' ? buttonCode.generateLaunchJson : buttonCode.configureLaunchJson,
+                'VSCode.buttonCode': LaunchConfigManager.instance.getLaunchConfig() === 'None' ? buttonCode.generateLaunchJson : buttonCode.configureLaunchJson,
             });
-            void configureLaunchJson();
-            setLaunchConfig();
+            void LaunchConfigManager.instance.configureLaunchJson();
         }));
     context.subscriptions.push(vscode.commands.registerCommand(
         `${SETTINGS_VIEW_NAME}.launchProject`,
         () => {
             telemetryReporter.sendTelemetryEvent('user/buttonPress', { 'VSCode.buttonCode': buttonCode.launchProject });
-            setLaunchConfig();
-            const isValidLaunchConfig = typeof launchConfig === 'object';
-            if (vscode.workspace.workspaceFolders && isValidLaunchConfig) {
-                void vscode.debug.startDebugging(vscode.workspace.workspaceFolders[0], launchConfig);
+            LaunchConfigManager.instance.updateLaunchConfig();
+            if (vscode.workspace.workspaceFolders && LaunchConfigManager.instance.isValidLaunchConfig) {
+                void vscode.debug.startDebugging(vscode.workspace.workspaceFolders[0], LaunchConfigManager.instance.getLaunchConfig());
                 cdpTargetsProvider.refresh();
             }
         }));
@@ -348,7 +342,3 @@ export async function launch(context: vscode.ExtensionContext, launchUrl?: strin
         await attach(context, url, config);
     }
 }
-
-export function setLaunchConfig(): void {
-    launchConfig = getLaunchJson();
-}
diff --git a/src/launchConfigManager.ts b/src/launchConfigManager.ts
new file mode 100644
index 0000000..853f41e
--- /dev/null
+++ b/src/launchConfigManager.ts
@@ -0,0 +1,109 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+import * as vscode from 'vscode';
+import * as fse from 'fs-extra';
+import { SETTINGS_STORE_NAME } from './utils';
+export type LaunchConfig = 'None' | 'Unsupported' | vscode.DebugConfiguration;
+
+export const providedDebugConfig: vscode.DebugConfiguration = {
+    name: 'Launch Microsoft Edge and open the Edge DevTools',
+    request: 'launch',
+    type: `${SETTINGS_STORE_NAME}.debug`,
+    url: '',
+};
+
+export class LaunchConfigManager {
+    private launchConfig: LaunchConfig;
+    private isValidConfig: boolean;
+    private static launchConfigManagerInstance: LaunchConfigManager;
+
+    private constructor() {
+        this.launchConfig = 'None';
+        this.isValidConfig = false;
+        this.updateLaunchConfig();
+    }
+
+    static get instance(): LaunchConfigManager {
+        if (!LaunchConfigManager.launchConfigManagerInstance) {
+            LaunchConfigManager.launchConfigManagerInstance = new LaunchConfigManager();
+        }
+        return LaunchConfigManager.launchConfigManagerInstance;
+    }
+
+    getLaunchConfig(): LaunchConfig {
+        this.updateLaunchConfig();
+        return this.launchConfig;
+    }
+
+    updateLaunchConfig(): void {
+        // Check if there is a folder open
+        if (!vscode.workspace.workspaceFolders) {
+            void vscode.commands.executeCommand('setContext', 'launchJsonStatus', 'None');
+            this.launchConfig = 'None';
+            this.isValidConfig = false;
+            return;
+        }
+
+        // Check if there's a launch.json file
+        const workspaceUri = vscode.workspace.workspaceFolders[0].uri;
+        const filePath = `${workspaceUri.fsPath}/.vscode/launch.json`;
+        if (fse.pathExistsSync(filePath)) {
+            // Check if there is a supported debug config
+            const configs = vscode.workspace.getConfiguration('launch', workspaceUri).get('configurations') as vscode.DebugConfiguration[];
+            for (const config of configs) {
+                if (config.type === 'vscode-edge-devtools.debug' || config.type === 'msedge' || config.type === 'edge') {
+                    void vscode.commands.executeCommand('setContext', 'launchJsonStatus', 'Supported');
+                    this.launchConfig = config;
+                    this.isValidConfig = true;
+                    return;
+                }
+            }
+            void vscode.commands.executeCommand('setContext', 'launchJsonStatus', 'Unsupported');
+            this.launchConfig = 'Unsupported';
+            this.isValidConfig = false;
+            return;
+        }
+        void vscode.commands.executeCommand('setContext', 'launchJsonStatus', 'None');
+        this.launchConfig = 'None';
+        this.isValidConfig = false;
+    }
+
+    /**
+     * Add a template for a supported debug configuration to launch.json
+     * @returns {void}
+     */
+    async configureLaunchJson(): Promise<void> {
+        if (!vscode.workspace.workspaceFolders) {
+            void vscode.window.showErrorMessage('Cannot configure launch.json for an empty workspace. Please open a folder in the editor.');
+            return;
+        }
+
+        // Create ./.vscode/launch.json if it doesn't already exist
+        const workspaceUri = vscode.workspace.workspaceFolders[0].uri;
+        const relativePath = '/.vscode/launch.json';
+        fse.ensureFileSync(workspaceUri.fsPath + relativePath);
+
+        // Append a supported debug config to their list of configurations and update workspace configuration
+        const launchJson = vscode.workspace.getConfiguration('launch', workspaceUri);
+        const configs = launchJson.get('configurations') as vscode.DebugConfiguration[];
+        configs.push(providedDebugConfig);
+        await launchJson.update('configurations', configs) as unknown as Promise<void>;
+
+        // Insert instruction comment
+        let launchText = fse.readFileSync(workspaceUri.fsPath + relativePath).toString();
+        const re = new RegExp(`{(.|\\n|\\s)*(${providedDebugConfig.type})(.|\\n|\\s)*(${providedDebugConfig.url}")`, 'm');
+        const match = re.exec(launchText);
+        const instructions = ' // Provide your project\'s url to finish configuring';
+        launchText = launchText.replace(re, `${match ? match[0] : ''}${instructions}`);
+        fse.writeFileSync(workspaceUri.fsPath + relativePath, launchText);
+
+        // Open launch.json in editor
+        void vscode.commands.executeCommand('vscode.open', vscode.Uri.joinPath(workspaceUri, relativePath));
+        this.updateLaunchConfig();
+    }
+
+    isValidLaunchConfig(): boolean {
+        return this.isValidConfig;
+    }
+}
diff --git a/src/launchDebugProvider.ts b/src/launchDebugProvider.ts
index b945f4c..572a0ea 100644
--- a/src/launchDebugProvider.ts
+++ b/src/launchDebugProvider.ts
@@ -5,11 +5,11 @@ import * as vscode from 'vscode';
 import TelemetryReporter from 'vscode-extension-telemetry';
 import {
     IUserConfig,
-    providedDebugConfig,
     SETTINGS_DEFAULT_ATTACH_INTERVAL,
     SETTINGS_DEFAULT_EDGE_DEBUGGER_PORT,
     SETTINGS_STORE_NAME,
 } from './utils';
+import { providedDebugConfig } from './launchConfigManager';
 
 type AttachCallback = (
     context: vscode.ExtensionContext,
diff --git a/src/utils.ts b/src/utils.ts
index ad23dee..4b142da 100644
--- a/src/utils.ts
+++ b/src/utils.ts
@@ -96,12 +96,6 @@ export const SETTINGS_DEFAULT_SOURCE_MAPS = true;
 export const SETTINGS_DEFAULT_EDGE_DEBUGGER_PORT = 2015;
 export const SETTINGS_DEFAULT_ATTACH_TIMEOUT = 10000;
 export const SETTINGS_DEFAULT_ATTACH_INTERVAL = 200;
-export const providedDebugConfig: vscode.DebugConfiguration = {
-    name: 'Launch Microsoft Edge and open the Edge DevTools',
-    request: 'launch',
-    type: `${SETTINGS_STORE_NAME}.debug`,
-    url: '',
-};
 
 const WIN_APP_DATA = process.env.LOCALAPPDATA || '/';
 const msEdgeBrowserMapping: Map<BrowserFlavor, IBrowserPath> = new Map<BrowserFlavor, IBrowserPath>();
@@ -132,8 +126,6 @@ export const buttonCode: Record<string, string> = {
     closeTarget: '9',
 };
 
-export type LaunchConfig = 'None' | 'Unsupported' | vscode.DebugConfiguration;
-
 /**
  * Fetch the response for the given uri.
  *
@@ -348,69 +340,6 @@ export async function getBrowserPath(config: Partial<IUserConfig> = {}): Promise
     }
 }
 
-/**
- * Gets a supported debug config and updates the status of the launch.json file associated with the current workspace
- * @returns LaunchConfig
- */
- export function getLaunchJson(): LaunchConfig {
-    // Check if there is a folder open
-    if (!vscode.workspace.workspaceFolders) {
-        void vscode.commands.executeCommand('setContext', 'launchJsonStatus', 'None');
-        return 'None';
-    }
-
-    // Check if there's a launch.json file
-    const workspaceUri = vscode.workspace.workspaceFolders[0].uri;
-    const filePath = `${workspaceUri.fsPath}/.vscode/launch.json`;
-    if (fse.pathExistsSync(filePath)) {
-        // Check if there is a supported debug config
-        const configs = vscode.workspace.getConfiguration('launch', workspaceUri).get('configurations') as vscode.DebugConfiguration[];
-        for (const config of configs) {
-            if (config.type === 'vscode-edge-devtools.debug' || config.type === 'msedge' || config.type === 'edge') {
-                void vscode.commands.executeCommand('setContext', 'launchJsonStatus', 'Supported');
-                return config;
-            }
-        }
-        void vscode.commands.executeCommand('setContext', 'launchJsonStatus', 'Unsupported');
-        return 'Unsupported';
-    }
-    void vscode.commands.executeCommand('setContext', 'launchJsonStatus', 'None');
-    return 'None';
-}
-
-/**
- * Add a template for a supported debug configuration to launch.json
- * @returns {void}
- */
-export async function configureLaunchJson(): Promise<void> {
-    if (!vscode.workspace.workspaceFolders) {
-        void vscode.window.showErrorMessage('Cannot configure launch.json for an empty workspace. Please open a folder in the editor.');
-        return;
-    }
-
-    // Create ./.vscode/launch.json if it doesn't already exist
-    const workspaceUri = vscode.workspace.workspaceFolders[0].uri;
-    const relativePath = '/.vscode/launch.json';
-    fse.ensureFileSync(workspaceUri.fsPath + relativePath);
-
-    // Append a supported debug config to their list of configurations and update workspace configuration
-    const launchJson = vscode.workspace.getConfiguration('launch', workspaceUri);
-    const configs = launchJson.get('configurations') as vscode.DebugConfiguration[];
-    configs.push(providedDebugConfig);
-    await launchJson.update('configurations', configs) as unknown as Promise<void>;
-
-    // Insert instruction comment
-    let launchText = fse.readFileSync(workspaceUri.fsPath + relativePath).toString();
-    const re = new RegExp(`{(.|\\n|\\s)*(${providedDebugConfig.type})(.|\\n|\\s)*(${providedDebugConfig.url}")`, 'm');
-    const match = re.exec(launchText);
-    const instructions = ' // Provide your project\'s url to finish configuring';
-    launchText = launchText.replace(re, `${match ? match[0] : ''}${instructions}`);
-    fse.writeFileSync(workspaceUri.fsPath + relativePath, launchText);
-
-    // Open launch.json in editor
-    void vscode.commands.executeCommand('vscode.open', vscode.Uri.joinPath(workspaceUri, relativePath));
-}
-
 /**
  * Launch the specified browser with remote debugging enabled
  *


Test patch:
diff --git a/test/extension.test.ts b/test/extension.test.ts
index 34c8ce3..3c2d784 100644
--- a/test/extension.test.ts
+++ b/test/extension.test.ts
@@ -41,7 +41,6 @@ describe("extension", () => {
                 getRemoteEndpointSettings: jest.fn(),
                 getRuntimeConfig: jest.fn(),
                 removeTrailingSlash: jest.fn(removeTrailingSlash),
-                getLaunchJson: jest.fn(),
                 getJsDebugCDPProxyWebsocketUrl: jest.fn(),
                 getActiveDebugSessionId: jest.fn(),
             };
@@ -400,7 +399,6 @@ describe("extension", () => {
                 launchBrowser: jest.fn().mockResolvedValue(fakeBrowser),
                 openNewTab: jest.fn().mockResolvedValue(null),
                 removeTrailingSlash: jest.fn(removeTrailingSlash),
-                getLaunchJson: jest.fn(),
                 getJsDebugCDPProxyWebsocketUrl: jest.fn(),
                 buttonCode: { launch: '' },
                 reportUrlType: jest.fn(),
diff --git a/test/launchConfigManager.test.ts b/test/launchConfigManager.test.ts
new file mode 100644
index 0000000..ba7a4ed
--- /dev/null
+++ b/test/launchConfigManager.test.ts
@@ -0,0 +1,100 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+import {createFakeVSCode} from "./helpers/helpers";
+import { LaunchConfigManager, providedDebugConfig} from "../src/launchConfigManager";
+
+jest.mock("vscode", () => createFakeVSCode(), { virtual: true });
+jest.mock("fs-extra");
+
+describe("launchConfigManager", () => {
+
+    describe('getLaunchJson', () => {
+        it('updates launchJsonStatus with "None" when launch.json does not exist', async () => {
+            const vscodeMock = jest.requireMock("vscode");
+            const fse = jest.requireMock("fs-extra");
+            vscodeMock.workspace.getConfiguration.mockImplementation(() => {
+                return {
+                    get: (name: string) => [{type: 'vscode-edge-devtools.debug'}]
+                }
+            });
+            fse.pathExistsSync.mockImplementation(() => false);
+            const launchConfigManager = LaunchConfigManager.instance;
+            expect(launchConfigManager.getLaunchConfig()).toEqual('None');
+            expect(vscodeMock.commands.executeCommand).toBeCalledWith('setContext', 'launchJsonStatus', 'None');
+        });
+
+        it('updates launchJsonStatus with "Unsupported" when there is no supported debug config', async () => {
+            const vscodeMock = jest.requireMock("vscode");
+            const fse = jest.requireMock("fs-extra");
+            fse.pathExistsSync.mockImplementation(() => true);
+            vscodeMock.workspace.getConfiguration.mockImplementation(() => {
+                return {
+                    get: (name: string) => [{type: ''}]
+                }
+            });
+            const launchConfigManager = LaunchConfigManager.instance;
+            expect(launchConfigManager.getLaunchConfig()).toEqual('Unsupported');
+            expect(vscodeMock.commands.executeCommand).toBeCalledWith('setContext', 'launchJsonStatus', 'Unsupported');
+        });
+
+        it('returns a supported debug config when one exists', async () => {
+            const vscodeMock = jest.requireMock("vscode");
+            const fse = jest.requireMock("fs-extra");
+            fse.pathExistsSync.mockImplementation(() => true);
+            vscodeMock.workspace.getConfiguration.mockImplementation(() => {
+                return {
+                    get: (name: string) => [{type: 'vscode-edge-devtools.debug'}]
+                }
+            });
+            const launchConfigManager = LaunchConfigManager.instance;
+            expect(launchConfigManager.getLaunchConfig()).toEqual({type: 'vscode-edge-devtools.debug'});
+            expect(vscodeMock.commands.executeCommand).toBeCalledWith('setContext', 'launchJsonStatus', 'Supported');
+        });
+
+        it('updates launchJsonStatus with "None" when there is no folder open', async () => {
+            const vscodeMock = jest.requireMock("vscode");
+            const launchConfigManager = LaunchConfigManager.instance;
+            vscodeMock.workspace.workspaceFolders = null;
+            expect(launchConfigManager.getLaunchConfig()).toEqual('None');
+            expect(vscodeMock.commands.executeCommand).toBeCalledWith('setContext', 'launchJsonStatus', 'None');
+        });
+    });
+
+    describe('configureLaunchJson', () => {
+        it('adds a debug config to launch.json', async () => {
+            const vscodeMock = jest.requireMock("vscode");
+            const fse = jest.requireMock("fs-extra");
+            fse.readFileSync.mockImplementation((() => ''));
+            vscodeMock.workspace.workspaceFolders = [{
+                uri:  'file:///g%3A/GIT/testPage'
+            }];
+            vscodeMock.WorkspaceConfiguration = {
+                update: jest.fn((name: string, value: any) => {}),
+            };
+            vscodeMock.workspace.getConfiguration.mockImplementation(() => {
+                return {
+                        get: jest.fn((name: string) => []),
+                        update: vscodeMock.WorkspaceConfiguration.update,
+                }
+            });
+            vscodeMock.Uri.joinPath = jest.fn();
+            const launchConfigManager = LaunchConfigManager.instance;
+            launchConfigManager.configureLaunchJson();
+            expect(vscodeMock.WorkspaceConfiguration.update).toBeCalledWith('configurations', expect.arrayContaining([expect.any(Object)]));
+        });
+
+        it('inserts a comment after the url property', async () => {
+            const fse = jest.requireMock("fs-extra");
+            const expectedText = '\"url\":\"' + providedDebugConfig.url + '\" // Provide your project\'s url to finish configuring';
+            fse.readFileSync.mockImplementation(() => JSON.stringify(providedDebugConfig));
+            const launchConfigManager = LaunchConfigManager.instance;
+            await launchConfigManager.configureLaunchJson();
+            expect(fse.writeFileSync).toHaveBeenCalledWith(expect.any(String), expect.stringContaining(expectedText));
+        });
+    });
+
+    afterAll(() => {
+        jest.resetModules();
+    });
+});
diff --git a/test/utils.test.ts b/test/utils.test.ts
index 3d4091b..bda8a26 100644
--- a/test/utils.test.ts
+++ b/test/utils.test.ts
@@ -547,98 +547,6 @@ describe("utils", () => {
         });
     });
 
-    describe('getLaunchJson', () => {
-        let fse: Mocked<typeof import("fs-extra")>;
-
-        beforeEach(async () => {
-            jest.doMock("fs-extra");
-            jest.resetModules();
-            utils = await import("../src/utils");
-            fse = jest.requireMock("fs-extra");
-        });
-
-        it('updates launchJsonStatus with "None" when there is no folder open', async () => {
-            const vscodeMock = await jest.requireMock("vscode");
-            vscodeMock.workspace.workspaceFolders = null;
-            utils.getLaunchJson();
-            expect(utils.getLaunchJson()).toEqual('None');
-            expect(vscodeMock.commands.executeCommand).toBeCalledWith('setContext', 'launchJsonStatus', 'None');
-        });
-
-        it('updates launchJsonStatus with "None" when launch.json does not exist', async () => {
-            const vscodeMock = await jest.requireMock("vscode");
-            fse.pathExistsSync.mockImplementation(() => false);
-            utils.getLaunchJson();
-            expect(utils.getLaunchJson()).toEqual('None');
-            expect(vscodeMock.commands.executeCommand).toBeCalledWith('setContext', 'launchJsonStatus', 'None');
-        });
-
-        it('updates launchJsonStatus with "Unsupported" when there is no supported debug config', async () => {
-            const vscodeMock = await jest.requireMock("vscode");
-            fse.pathExistsSync.mockImplementation(() => true);
-            vscodeMock.workspace.getConfiguration.mockImplementation(() => {
-                return {
-                    get: (name: string) => [{type: ''}]
-                }
-            });
-            expect(utils.getLaunchJson()).toEqual('Unsupported');
-            expect(vscodeMock.commands.executeCommand).toBeCalledWith('setContext', 'launchJsonStatus', 'Unsupported');
-        });
-
-        it('returns a supported debug config when one exists', async () => {
-            const vscodeMock = await jest.requireMock("vscode");
-            fse.pathExistsSync.mockImplementation(() => true);
-            vscodeMock.workspace.getConfiguration.mockImplementation(() => {
-                return {
-                    get: (name: string) => [{type: 'vscode-edge-devtools.debug'}]
-                }
-            });
-            expect(utils.getLaunchJson()).toEqual({type: 'vscode-edge-devtools.debug'});
-            expect(vscodeMock.commands.executeCommand).toBeCalledWith('setContext', 'launchJsonStatus', 'Supported');
-        });
-    });
-
-    describe('configureLaunchJson', () => {
-        let fse: Mocked<typeof import("fs-extra")>;
-
-        beforeEach(async () => {
-            jest.doMock("fs-extra");
-            jest.resetModules();
-            utils = await import("../src/utils");
-
-            fse = jest.requireMock("fs-extra");
-            fse.readFileSync.mockImplementation((() => ''));
-
-            const vscodeMock = await jest.requireMock("vscode");
-            vscodeMock.Uri.joinPath = jest.fn();
-            vscodeMock.WorkspaceConfiguration = {
-                update: jest.fn((name: string, value: any) => {}),
-            };
-            vscodeMock.workspace.getConfiguration.mockImplementation(() => {
-                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)]));
-        });
-
-        it('inserts a comment after the url property', async () => {
-            const expectedText = '\"url\":\"' + utils.providedDebugConfig.url + '\" // Provide your project\'s url to finish configuring';
-            fse.readFileSync.mockImplementation(() => JSON.stringify(utils.providedDebugConfig));
-
-            await utils.configureLaunchJson();
-            expect(fse.writeFileSync).toHaveBeenCalledWith(expect.any(String), expect.stringContaining(expectedText));
-        });
-    });
-
     describe("launchBrowser", () => {
         beforeEach(async () => {
             jest.mock("puppeteer-core", () => {