Add Prettier and ESLint tooling (Refs #77)

This commit is contained in:
2026-10-09 15:56:13 -04:00
parent 8ed059b8d3
commit 16469e2d43
711 changed files with 99737 additions and 28286 deletions
+9 -4
View File
@@ -5,10 +5,15 @@ describe('host CPU inventory', () => {
it('accepts older agents without CPU usage', () => {
expect(validateInventory({ cpuCount: 4 }).cpuUsagePercent).toBeUndefined();
});
it.each([0, 0.1, 42.3, 100])('accepts CPU usage %s', cpuUsagePercent => {
it.each([0, 0.1, 42.3, 100])('accepts CPU usage %s', (cpuUsagePercent) => {
expect(validateInventory({ cpuUsagePercent }).cpuUsagePercent).toBe(cpuUsagePercent);
});
it.each([-1, 100.1, NaN, Infinity, -Infinity, null, '25', true, {}])('rejects invalid CPU usage %j', cpuUsagePercent => {
expect(() => validateInventory({ cpuUsagePercent })).toThrow('Invalid inventory cpuUsagePercent');
});
it.each([-1, 100.1, NaN, Infinity, -Infinity, null, '25', true, {}])(
'rejects invalid CPU usage %j',
(cpuUsagePercent) => {
expect(() => validateInventory({ cpuUsagePercent })).toThrow(
'Invalid inventory cpuUsagePercent'
);
}
);
});