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

Added more tests + Update src/extensions/extension-discovery/is-compatible-extension/is-compatible-extension.ts

Co-authored-by: Jim Ehrismann <40840436+jim-docker@users.noreply.github.com>
This commit is contained in:
Roman 2022-05-10 13:33:07 +03:00
parent 2a9c5f8137
commit e1d6c0183d
2 changed files with 13 additions and 1 deletions

View File

@ -32,6 +32,18 @@ describe("Extension/App versions compatibility check", () => {
})(getExtensionManifestMock({ })(getExtensionManifestMock({
lensEngine: "5.5.0", lensEngine: "5.5.0",
}))).toBeTruthy(); }))).toBeTruthy();
expect(isCompatibleExtension({
appSemVer: semver.coerce("5.5.0-alpha.0"),
})(getExtensionManifestMock({
lensEngine: "^5.5.0",
}))).toBeTruthy();
expect(isCompatibleExtension({
appSemVer: semver.coerce("5.5"),
})(getExtensionManifestMock({
lensEngine: "^5.6.0",
}))).toBeFalsy();
}); });
it("is not compatible with upper %MAJOR version of base app", () => { it("is not compatible with upper %MAJOR version of base app", () => {

View File

@ -18,7 +18,7 @@ export const isCompatibleExtension = ({ appSemVer }: Dependencies): ((manifest:
if (!validVersion) { if (!validVersion) {
const errorInfo = [ const errorInfo = [
`Invalid format for "manifest.engines.lens"="${manifestLensEngine}"`, `Invalid format for "manifest.engines.lens"="${manifestLensEngine}"`,
`Range versions could be specified only starting with '^'.`, `Range versions can only be specified starting with '^'.`,
`Otherwise it's recommended to use plain %MAJOR.%MINOR to match with supported Lens version.`, `Otherwise it's recommended to use plain %MAJOR.%MINOR to match with supported Lens version.`,
].join("\n"); ].join("\n");