mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Try to fix tests on Windows again.
Signed-off-by: Panu Horsmalahti <phorsmalahti@mirantis.com>
This commit is contained in:
parent
9bb72c4fa2
commit
b8f1dcc848
@ -1,5 +1,5 @@
|
|||||||
import { watch } from "chokidar";
|
import { watch } from "chokidar";
|
||||||
import { join } from "path";
|
import { join, normalize } from "path";
|
||||||
import { ExtensionDiscovery, InstalledExtension } from "../extension-discovery";
|
import { ExtensionDiscovery, InstalledExtension } from "../extension-discovery";
|
||||||
|
|
||||||
jest.mock("../../common/ipc");
|
jest.mock("../../common/ipc");
|
||||||
@ -46,13 +46,13 @@ describe("ExtensionDiscovery", () => {
|
|||||||
extensionDiscovery.events.on("add", (extension: InstalledExtension) => {
|
extensionDiscovery.events.on("add", (extension: InstalledExtension) => {
|
||||||
expect(extension).toEqual({
|
expect(extension).toEqual({
|
||||||
absolutePath: expect.any(String),
|
absolutePath: expect.any(String),
|
||||||
id: "node_modules/my-extension/package.json",
|
id: normalize("node_modules/my-extension/package.json"),
|
||||||
isBundled: false,
|
isBundled: false,
|
||||||
isEnabled: false,
|
isEnabled: false,
|
||||||
manifest: {
|
manifest: {
|
||||||
name: "my-extension",
|
name: "my-extension",
|
||||||
},
|
},
|
||||||
manifestPath: "node_modules/my-extension/package.json",
|
manifestPath: normalize("node_modules/my-extension/package.json"),
|
||||||
});
|
});
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
|
|||||||
@ -156,7 +156,6 @@ export class ExtensionDiscovery {
|
|||||||
}
|
}
|
||||||
|
|
||||||
handleWatchFileAdd = async (filePath: string) => {
|
handleWatchFileAdd = async (filePath: string) => {
|
||||||
logger.info(`${logModule} handleWatchFileAdd ${filePath}`);
|
|
||||||
// e.g. "foo/package.json"
|
// e.g. "foo/package.json"
|
||||||
const relativePath = path.relative(this.localFolderPath, filePath);
|
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.
|
// 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;
|
const isUnderLocalFolderPath = relativePath.split(path.sep).length === 2;
|
||||||
|
|
||||||
logger.info(`${logModule} relativePath ${relativePath} isUnderLocalFolderPath ${isUnderLocalFolderPath}`);
|
|
||||||
|
|
||||||
if (path.basename(filePath) === manifestFilename && isUnderLocalFolderPath) {
|
if (path.basename(filePath) === manifestFilename && isUnderLocalFolderPath) {
|
||||||
try {
|
try {
|
||||||
const absPath = path.dirname(filePath);
|
const absPath = path.dirname(filePath);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user