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 committed 2022-05-10 13:56:12 +03:00
1 parent 2a9c5f8137
commit e1d6c0183d
2 files changed
+13 -1

No files matched your search

@@ -32,6 +32,18 @@ describe("Extension/App versions compatibility check", () => {
})(getExtensionManifestMock({
lensEngine: "5.5.0",
}))).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", () => {
@@ -18,7 +18,7 @@ export const isCompatibleExtension = ({ appSemVer }: Dependencies): ((manifest:
if (!validVersion) {
const errorInfo = [
`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.`,
].join("\n");