fixing tests, part 1

This commit is contained in:
Roman committed 2020-06-23 18:11:27 +03:00
1 parent e324ab1a55
commit da9b20030f
6 files changed
+18 -12

No files matched your search

+4
View File
@@ -6,6 +6,7 @@ import * as version260Beta2 from "../migrations/cluster-store/2.6.0-beta.2"
import * as version260Beta3 from "../migrations/cluster-store/2.6.0-beta.3"
import * as version270Beta0 from "../migrations/cluster-store/2.7.0-beta.0"
import * as version270Beta1 from "../migrations/cluster-store/2.7.0-beta.1"
import { getAppVersion } from "./utils/app-version";
export class ClusterStore {
private static instance: ClusterStore;
@@ -13,6 +14,9 @@ export class ClusterStore {
private constructor() {
this.store = new ElectronStore({
// @ts-ignore
// fixme: tests are failed without "projectVersion"
projectVersion: getAppVersion(),
name: "lens-cluster-store",
accessPropertiesByDotNotation: false, // To make dots safe in cluster context names
migrations: {
+4
View File
@@ -1,5 +1,6 @@
import ElectronStore from "electron-store"
import * as version210Beta4 from "../migrations/user-store/2.1.0-beta.4"
import { getAppVersion } from "./utils/app-version";
export interface User {
id?: string;
@@ -19,6 +20,9 @@ export class UserStore {
private constructor() {
this.store = new ElectronStore({
// @ts-ignore
// fixme: tests are failed without "projectVersion"
projectVersion: getAppVersion(),
migrations: {
"2.1.0-beta.4": version210Beta4.migration,
}
+1 -6
View File
@@ -1,10 +1,5 @@
import packageInfo from "../../../package.json"
import { app, remote } from "electron"
/**
* @returns app version correctly regardless of dev/prod mode and main/renderer differences
*/
export function getAppVersion(): string {
const version = (app || remote.app).getVersion();
return version || packageInfo.version;
return packageInfo.version;
}
+1 -1
View File
@@ -59,7 +59,7 @@ export class Kubectl {
public static readonly kubectlDir = path.join((app || remote.app).getPath("userData"), "binaries", "kubectl")
public static readonly bundledKubectlPath = bundledPath
public static readonly bundledKubectlVersion: string = bundledVersion
public static readonly bundledKubectlVersion = bundledVersion
private static bundledInstance: Kubectl;
// Returns the single bundled Kubectl instance