Add Prettier and ESLint tooling (Refs #77)
This commit is contained in:
@@ -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'
|
||||
);
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user