From b8f1dcc8488e1ad0f6f1b7712108f9392aff27a5 Mon Sep 17 00:00:00 2001 From: Panu Horsmalahti Date: Tue, 8 Dec 2020 15:05:23 +0200 Subject: [PATCH] Try to fix tests on Windows again. Signed-off-by: Panu Horsmalahti --- src/extensions/__tests__/extension-discovery.test.ts | 6 +++--- src/extensions/extension-discovery.ts | 3 --- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/extensions/__tests__/extension-discovery.test.ts b/src/extensions/__tests__/extension-discovery.test.ts index b6b8d184e0..0e72cf16fb 100644 --- a/src/extensions/__tests__/extension-discovery.test.ts +++ b/src/extensions/__tests__/extension-discovery.test.ts @@ -1,5 +1,5 @@ import { watch } from "chokidar"; -import { join } from "path"; +import { join, normalize } from "path"; import { ExtensionDiscovery, InstalledExtension } from "../extension-discovery"; jest.mock("../../common/ipc"); @@ -46,13 +46,13 @@ describe("ExtensionDiscovery", () => { extensionDiscovery.events.on("add", (extension: InstalledExtension) => { expect(extension).toEqual({ absolutePath: expect.any(String), - id: "node_modules/my-extension/package.json", + id: normalize("node_modules/my-extension/package.json"), isBundled: false, isEnabled: false, manifest: { name: "my-extension", }, - manifestPath: "node_modules/my-extension/package.json", + manifestPath: normalize("node_modules/my-extension/package.json"), }); done(); }); diff --git a/src/extensions/extension-discovery.ts b/src/extensions/extension-discovery.ts index 52a4f73d05..d0bfbc4c16 100644 --- a/src/extensions/extension-discovery.ts +++ b/src/extensions/extension-discovery.ts @@ -156,7 +156,6 @@ export class ExtensionDiscovery { } handleWatchFileAdd = async (filePath: string) => { - logger.info(`${logModule} handleWatchFileAdd ${filePath}`); // e.g. "foo/package.json" const relativePath = path.relative(this.localFolderPath, filePath); @@ -165,8 +164,6 @@ export class ExtensionDiscovery { // This safeguards against a file watch being triggered under a sub-directory which is not an extension. const isUnderLocalFolderPath = relativePath.split(path.sep).length === 2; - logger.info(`${logModule} relativePath ${relativePath} isUnderLocalFolderPath ${isUnderLocalFolderPath}`); - if (path.basename(filePath) === manifestFilename && isUnderLocalFolderPath) { try { const absPath = path.dirname(filePath);