mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Lint: comma-spacing (error) & comma-dangle (error) (#4200)
Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
1 parent
02e77afcd1
commit
c6dce043a7
406 files changed
+1590
-1580
No files matched your search
@@ -119,7 +119,7 @@ describe("Crds", () => {
|
||||
},
|
||||
spec: {
|
||||
version: "abc",
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
expect(crd.getVersion()).toBe("abc");
|
||||
|
||||
@@ -46,14 +46,14 @@ describe("DeploymentApi", () => {
|
||||
expect(patchSpy).toHaveBeenCalledWith("/apis/apps/v1/namespaces/default/deployments/deployment-1/scale", {
|
||||
data: {
|
||||
spec: {
|
||||
replicas: 5
|
||||
}
|
||||
}
|
||||
replicas: 5,
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
headers: {
|
||||
"content-type": "application/merge-patch+json"
|
||||
}
|
||||
"content-type": "application/merge-patch+json",
|
||||
},
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -282,7 +282,7 @@ describe("HelmChart tests", () => {
|
||||
|
||||
expect(warnFn).toHaveBeenCalledWith("HelmChart data has unexpected fields", {
|
||||
original: anyObject(),
|
||||
unknownFields: ["asdjhajksdhadjks"]
|
||||
unknownFields: ["asdjhajksdhadjks"],
|
||||
});
|
||||
console.warn = warn;
|
||||
});
|
||||
|
||||
@@ -26,7 +26,7 @@ jest.mock("../api-manager", () => ({
|
||||
return {
|
||||
registerStore: jest.fn(),
|
||||
};
|
||||
}
|
||||
},
|
||||
}));
|
||||
|
||||
import { IKubeApiParsed, parseKubeApi } from "../kube-api-parse";
|
||||
@@ -45,7 +45,7 @@ const tests: KubeApiParseTestData[] = [
|
||||
apiVersionWithGroup: "apiextensions.k8s.io/v1beta1",
|
||||
namespace: undefined,
|
||||
resource: "customresourcedefinitions",
|
||||
name: "prometheuses.monitoring.coreos.com"
|
||||
name: "prometheuses.monitoring.coreos.com",
|
||||
}],
|
||||
["/api/v1/namespaces/kube-system/pods/coredns-6955765f44-v8p27", {
|
||||
apiBase: "/api/v1/pods",
|
||||
@@ -55,7 +55,7 @@ const tests: KubeApiParseTestData[] = [
|
||||
apiVersionWithGroup: "v1",
|
||||
namespace: "kube-system",
|
||||
resource: "pods",
|
||||
name: "coredns-6955765f44-v8p27"
|
||||
name: "coredns-6955765f44-v8p27",
|
||||
}],
|
||||
["/apis/stable.example.com/foo1/crontabs", {
|
||||
apiBase: "/apis/stable.example.com/foo1/crontabs",
|
||||
@@ -132,7 +132,7 @@ const tests: KubeApiParseTestData[] = [
|
||||
const throwtests = [
|
||||
undefined,
|
||||
"",
|
||||
"ajklsmh"
|
||||
"ajklsmh",
|
||||
];
|
||||
|
||||
describe("parseApi unit tests", () => {
|
||||
|
||||
@@ -28,11 +28,11 @@ describe("forRemoteCluster", () => {
|
||||
it("builds api client", async (done) => {
|
||||
const api = forRemoteCluster({
|
||||
cluster: {
|
||||
server: "https://127.0.0.1:6443"
|
||||
server: "https://127.0.0.1:6443",
|
||||
},
|
||||
user: {
|
||||
token: "daa"
|
||||
}
|
||||
token: "daa",
|
||||
},
|
||||
}, Pod);
|
||||
|
||||
(fetch as any).mockResponse(async (request: any) => {
|
||||
@@ -41,7 +41,7 @@ describe("forRemoteCluster", () => {
|
||||
done();
|
||||
|
||||
return {
|
||||
body: ""
|
||||
body: "",
|
||||
};
|
||||
});
|
||||
|
||||
@@ -55,7 +55,7 @@ describe("KubeApi", () => {
|
||||
beforeEach(() => {
|
||||
request = new KubeJsonApi({
|
||||
serverAddress: `http://127.0.0.1:9999`,
|
||||
apiBase: "/api-kube"
|
||||
apiBase: "/api-kube",
|
||||
});
|
||||
});
|
||||
|
||||
@@ -65,24 +65,24 @@ describe("KubeApi", () => {
|
||||
return {
|
||||
body: JSON.stringify({
|
||||
resources: [{
|
||||
name: "ingresses"
|
||||
}] as any[]
|
||||
})
|
||||
name: "ingresses",
|
||||
}] as any[],
|
||||
}),
|
||||
};
|
||||
} else if (request.url === "http://127.0.0.1:9999/api-kube/apis/extensions/v1beta1") {
|
||||
// Even if the old API contains ingresses, KubeApi should prefer the apiBase url
|
||||
return {
|
||||
body: JSON.stringify({
|
||||
resources: [{
|
||||
name: "ingresses"
|
||||
}] as any[]
|
||||
})
|
||||
name: "ingresses",
|
||||
}] as any[],
|
||||
}),
|
||||
};
|
||||
} else {
|
||||
return {
|
||||
body: JSON.stringify({
|
||||
resources: [] as any[]
|
||||
})
|
||||
resources: [] as any[],
|
||||
}),
|
||||
};
|
||||
}
|
||||
});
|
||||
@@ -107,22 +107,22 @@ describe("KubeApi", () => {
|
||||
if (request.url === "http://127.0.0.1:9999/api-kube/apis/networking.k8s.io/v1") {
|
||||
return {
|
||||
body: JSON.stringify({
|
||||
resources: [] as any[]
|
||||
})
|
||||
resources: [] as any[],
|
||||
}),
|
||||
};
|
||||
} else if (request.url === "http://127.0.0.1:9999/api-kube/apis/extensions/v1beta1") {
|
||||
return {
|
||||
body: JSON.stringify({
|
||||
resources: [{
|
||||
name: "ingresses"
|
||||
}] as any[]
|
||||
})
|
||||
name: "ingresses",
|
||||
}] as any[],
|
||||
}),
|
||||
};
|
||||
} else {
|
||||
return {
|
||||
body: JSON.stringify({
|
||||
resources: [] as any[]
|
||||
})
|
||||
resources: [] as any[],
|
||||
}),
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
@@ -45,8 +45,8 @@ function getDummyPod(opts: GetDummyPodOptions = getDummyPodDefaultOptions()): Po
|
||||
uid: "1",
|
||||
name: "test",
|
||||
resourceVersion: "v1",
|
||||
selfLink: "http"
|
||||
}
|
||||
selfLink: "http",
|
||||
},
|
||||
});
|
||||
|
||||
pod.spec = {
|
||||
@@ -82,9 +82,9 @@ function getDummyPod(opts: GetDummyPodOptions = getDummyPodDefaultOptions()): Po
|
||||
restartCount: i,
|
||||
state: {
|
||||
running: {
|
||||
startedAt: "before"
|
||||
startedAt: "before",
|
||||
},
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
@@ -107,9 +107,9 @@ function getDummyPod(opts: GetDummyPodOptions = getDummyPodDefaultOptions()): Po
|
||||
startedAt: "before",
|
||||
exitCode: i+1,
|
||||
finishedAt: "later",
|
||||
reason: `reason_${i}`
|
||||
}
|
||||
}
|
||||
reason: `reason_${i}`,
|
||||
},
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
@@ -129,9 +129,9 @@ function getDummyPod(opts: GetDummyPodOptions = getDummyPodDefaultOptions()): Po
|
||||
restartCount: i,
|
||||
state: {
|
||||
running: {
|
||||
startedAt: "before"
|
||||
}
|
||||
}
|
||||
startedAt: "before",
|
||||
},
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
@@ -154,9 +154,9 @@ function getDummyPod(opts: GetDummyPodOptions = getDummyPodDefaultOptions()): Po
|
||||
startedAt: "before",
|
||||
exitCode: i+1,
|
||||
finishedAt: "later",
|
||||
reason: `reason_${i}`
|
||||
}
|
||||
}
|
||||
reason: `reason_${i}`,
|
||||
},
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
@@ -183,7 +183,7 @@ describe("Pods", () => {
|
||||
return {
|
||||
image: "dummy",
|
||||
imagePullPolicy: "dummy",
|
||||
name
|
||||
name,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -231,7 +231,7 @@ describe("Pods", () => {
|
||||
const pod = getDummyPod();
|
||||
|
||||
pod.spec.nodeSelector = {
|
||||
"kubernetes.io/os": "foobar"
|
||||
"kubernetes.io/os": "foobar",
|
||||
};
|
||||
|
||||
expect(pod.getSelectedNodeOs()).toStrictEqual("foobar");
|
||||
@@ -241,7 +241,7 @@ describe("Pods", () => {
|
||||
const pod = getDummyPod();
|
||||
|
||||
pod.spec.nodeSelector = {
|
||||
"beta.kubernetes.io/os": "foobar1"
|
||||
"beta.kubernetes.io/os": "foobar1",
|
||||
};
|
||||
|
||||
expect(pod.getSelectedNodeOs()).toStrictEqual("foobar1");
|
||||
@@ -252,7 +252,7 @@ describe("Pods", () => {
|
||||
|
||||
pod.spec.nodeSelector = {
|
||||
"kubernetes.io/os": "foobar2",
|
||||
"beta.kubernetes.io/os": "foobar3"
|
||||
"beta.kubernetes.io/os": "foobar3",
|
||||
};
|
||||
|
||||
expect(pod.getSelectedNodeOs()).toStrictEqual("foobar2");
|
||||
@@ -273,7 +273,7 @@ describe("Pods", () => {
|
||||
type: "Ready",
|
||||
status: "foobar",
|
||||
lastProbeTime: 1,
|
||||
lastTransitionTime: "longer ago"
|
||||
lastTransitionTime: "longer ago",
|
||||
});
|
||||
|
||||
expect(pod.hasIssues()).toStrictEqual(true);
|
||||
@@ -286,7 +286,7 @@ describe("Pods", () => {
|
||||
type: "dummy",
|
||||
status: "foobar",
|
||||
lastProbeTime: 1,
|
||||
lastTransitionTime: "longer ago"
|
||||
lastTransitionTime: "longer ago",
|
||||
});
|
||||
|
||||
expect(pod.hasIssues()).toStrictEqual(false);
|
||||
@@ -298,8 +298,8 @@ describe("Pods", () => {
|
||||
pod.status.containerStatuses[0].state = {
|
||||
waiting: {
|
||||
reason: "CrashLookBackOff",
|
||||
message: "too much foobar"
|
||||
}
|
||||
message: "too much foobar",
|
||||
},
|
||||
};
|
||||
|
||||
expect(pod.hasIssues()).toStrictEqual(true);
|
||||
|
||||
@@ -46,14 +46,14 @@ describe("StatefulSetApi", () => {
|
||||
expect(patchSpy).toHaveBeenCalledWith("/apis/apps/v1/namespaces/default/statefulsets/statefulset-1/scale", {
|
||||
data: {
|
||||
spec: {
|
||||
replicas: 5
|
||||
}
|
||||
}
|
||||
replicas: 5,
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
headers: {
|
||||
"content-type": "application/merge-patch+json"
|
||||
}
|
||||
"content-type": "application/merge-patch+json",
|
||||
},
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user