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:
parent
163974f013
commit
09a0750a2d
@ -39,9 +39,9 @@ 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([
|
||||||
{
|
{
|
||||||
comparator: "",
|
comparator: "",
|
||||||
@ -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);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -89,13 +89,13 @@ describe("extension compatibility", () => {
|
|||||||
appSemVer.patch = 3;
|
appSemVer.patch = 3;
|
||||||
appSemVer.prerelease = ["beta", 3];
|
appSemVer.prerelease = ["beta", 3];
|
||||||
});
|
});
|
||||||
|
|
||||||
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([
|
||||||
{
|
{
|
||||||
comparator: "",
|
comparator: "",
|
||||||
@ -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);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@ -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;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user