mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
cleanup Lens repo with tighter linting
Signed-off-by: Sebastian Malton <smalton@mirantis.com>
This commit is contained in:
1 parent
e468105143
commit
b1ff34879a
470 files changed
+8447
-7443
No files matched your search
@@ -9,14 +9,14 @@ describe("k8s CPU units conversion", () => {
|
||||
"100m", // 0.1
|
||||
"930000n", // 0.00093
|
||||
"3028u", // 0.003028
|
||||
]
|
||||
const cpuCores = units.map(unit => cpuUnitsToNumber(unit))
|
||||
];
|
||||
const cpuCores = units.map(unit => cpuUnitsToNumber(unit));
|
||||
const expected = [
|
||||
0.5,
|
||||
0.1,
|
||||
0.00093,
|
||||
0.003028
|
||||
]
|
||||
expect(cpuCores).toEqual(expected)
|
||||
];
|
||||
expect(cpuCores).toEqual(expected);
|
||||
});
|
||||
});
|
||||
@@ -11,8 +11,8 @@ describe("Kubernetes units conversion", () => {
|
||||
4596968000, // 4.2Gi
|
||||
4596968000000, // 4.1Ti
|
||||
1.2384898975269E+15 // 1.1Pi
|
||||
]
|
||||
const units = bytes.map(byte => bytesToUnits(byte))
|
||||
];
|
||||
const units = bytes.map(byte => bytesToUnits(byte));
|
||||
const expected = [
|
||||
"128B",
|
||||
"2.0Ki",
|
||||
@@ -20,22 +20,22 @@ describe("Kubernetes units conversion", () => {
|
||||
"4.3Gi",
|
||||
"4.2Ti",
|
||||
"1.1Pi"
|
||||
]
|
||||
expect(units).toEqual(expected)
|
||||
];
|
||||
expect(units).toEqual(expected);
|
||||
});
|
||||
|
||||
test("Convert bytes to units with decimal precision", () => {
|
||||
const bytes = [
|
||||
2107152, // 2.010Mi
|
||||
4596968000, // 4.281Gi
|
||||
]
|
||||
const units = bytes.map(byte => bytesToUnits(byte, 3))
|
||||
];
|
||||
const units = bytes.map(byte => bytesToUnits(byte, 3));
|
||||
const expected = [
|
||||
"2.010Mi",
|
||||
"4.281Gi"
|
||||
]
|
||||
expect(units).toEqual(expected)
|
||||
})
|
||||
];
|
||||
expect(units).toEqual(expected);
|
||||
});
|
||||
|
||||
test("Convert 0 to bytes", () => {
|
||||
expect(bytesToUnits(0)).toEqual("N/A");
|
||||
@@ -49,7 +49,7 @@ describe("Kubernetes units conversion", () => {
|
||||
"7.99Gi", // 8579197173
|
||||
"2Ti", // 2199023255552
|
||||
"1Pi", // 1125899906842624
|
||||
]
|
||||
];
|
||||
const expected = [
|
||||
128,
|
||||
22528,
|
||||
@@ -57,9 +57,9 @@ describe("Kubernetes units conversion", () => {
|
||||
8579197173,
|
||||
2199023255552,
|
||||
1125899906842624
|
||||
]
|
||||
const bytes = units.map(unitsToBytes)
|
||||
expect(bytes).toEqual(expected)
|
||||
];
|
||||
const bytes = units.map(unitsToBytes);
|
||||
expect(bytes).toEqual(expected);
|
||||
});
|
||||
|
||||
test("Convert shorten units to bytes", () => {
|
||||
@@ -70,7 +70,7 @@ describe("Kubernetes units conversion", () => {
|
||||
"7.99G", // 8579197173
|
||||
"2T", // 2199023255552
|
||||
"1P", // 1125899906842624
|
||||
]
|
||||
];
|
||||
const expected = [
|
||||
128,
|
||||
22528,
|
||||
@@ -78,9 +78,9 @@ describe("Kubernetes units conversion", () => {
|
||||
8579197173,
|
||||
2199023255552,
|
||||
1125899906842624
|
||||
]
|
||||
const bytes = units.map(unitsToBytes)
|
||||
expect(bytes).toEqual(expected)
|
||||
];
|
||||
const bytes = units.map(unitsToBytes);
|
||||
expect(bytes).toEqual(expected);
|
||||
});
|
||||
|
||||
test("Convert strange unit to bytes", () => {
|
||||
|
||||
Reference in new issue
Block a user