1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

Add comment, fix tests

Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
Sebastian Malton 2021-07-16 12:05:12 -04:00
parent 163974f013
commit 09a0750a2d
2 changed files with 8 additions and 7 deletions

View File

@ -39,7 +39,7 @@ describe("extension compatibility", () => {
it("has no extension comparator", () => { it("has no extension comparator", () => {
const manifest = { name: "extensionName", version: "0.0.1"}; const manifest = { name: "extensionName", version: "0.0.1"};
expect(isCompatibleExtension(manifest,)).toBe(false); expect(isCompatibleExtension(manifest, false)).toBe(false);
}); });
it.each([ it.each([
@ -78,7 +78,7 @@ describe("extension compatibility", () => {
])("extension comparator test: %p", ({ comparator, expected }) => { ])("extension comparator test: %p", ({ comparator, expected }) => {
const manifest: LensExtensionManifest = { name: "extensionName", version: "0.0.1", engines: { lens: comparator}}; const manifest: LensExtensionManifest = { name: "extensionName", version: "0.0.1", engines: { lens: comparator}};
expect(isCompatibleExtension(manifest,)).toBe(expected); expect(isCompatibleExtension(manifest, false)).toBe(expected);
}); });
}); });
@ -93,7 +93,7 @@ describe("extension compatibility", () => {
it("has no extension comparator", () => { it("has no extension comparator", () => {
const manifest = { name: "extensionName", version: "0.0.1"}; const manifest = { name: "extensionName", version: "0.0.1"};
expect(isCompatibleExtension(manifest,)).toBe(false); expect(isCompatibleExtension(manifest, false)).toBe(false);
}); });
it.each([ it.each([
@ -132,7 +132,7 @@ describe("extension compatibility", () => {
])("extension comparator test: %p", ({ comparator, expected }) => { ])("extension comparator test: %p", ({ comparator, expected }) => {
const manifest: LensExtensionManifest = { name: "extensionName", version: "0.0.1", engines: { lens: comparator}}; const manifest: LensExtensionManifest = { name: "extensionName", version: "0.0.1", engines: { lens: comparator}};
expect(isCompatibleExtension(manifest,)).toBe(expected); expect(isCompatibleExtension(manifest, false)).toBe(expected);
}); });
}); });
}); });

View File

@ -25,6 +25,7 @@ import type { LensExtensionManifest } from "./lens-extension";
export function isCompatibleExtension(manifest: LensExtensionManifest, isBundled: boolean): boolean { export function isCompatibleExtension(manifest: LensExtensionManifest, isBundled: boolean): boolean {
if (manifest.engines?.lens) { if (manifest.engines?.lens) {
// We only started having bundled extensions specify the engine in v5
if (isBundled) { if (isBundled) {
return true; return true;
} }