test: add GPU and quota service tests
This commit is contained in:
22
test/quota.test.js
Normal file
22
test/quota.test.js
Normal file
@@ -0,0 +1,22 @@
|
||||
import { describe, it } from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
import { summarizeQuotaOutput } from '../src/services/quota.js';
|
||||
|
||||
describe('summarizeQuotaOutput', () => {
|
||||
it('summarizes ipads-quota json output', () => {
|
||||
const result = summarizeQuotaOutput('{"remaining":123,"usage":{"total":45}}');
|
||||
|
||||
assert.equal(result.kind, 'json');
|
||||
assert.equal(result.remaining, 123);
|
||||
assert.equal(result.used, 45);
|
||||
});
|
||||
|
||||
it('summarizes text output from custom quota commands', () => {
|
||||
const result = summarizeQuotaOutput('remaining: 80 used: 20 limit: 100');
|
||||
|
||||
assert.equal(result.kind, 'text');
|
||||
assert.equal(result.remaining, 80);
|
||||
assert.equal(result.used, 20);
|
||||
assert.equal(result.limit, 100);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user