Phase7
This commit is contained in:
28
apps/api/test/phase7.test.js
Normal file
28
apps/api/test/phase7.test.js
Normal file
@@ -0,0 +1,28 @@
|
||||
import { describe, it } from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
import { readFileSync } from 'node:fs';
|
||||
import { join } from 'node:path';
|
||||
|
||||
describe('phase 7 api contract', () => {
|
||||
it('documents idle shutdown and billing routes', () => {
|
||||
const billingSource = readFileSync(
|
||||
join(process.cwd(), 'src', 'billing/billing.controller.ts'),
|
||||
'utf8',
|
||||
);
|
||||
assert.ok(billingSource.includes("'wallet'"));
|
||||
assert.ok(billingSource.includes("'usage'"));
|
||||
|
||||
const idleSource = readFileSync(
|
||||
join(process.cwd(), 'src', 'servers/idle/idle.service.ts'),
|
||||
'utf8',
|
||||
);
|
||||
assert.ok(idleSource.includes('getIdleStatus'));
|
||||
assert.ok(idleSource.includes('extendIdleCountdown'));
|
||||
|
||||
const serversSource = readFileSync(
|
||||
join(process.cwd(), 'src', 'servers/servers.controller.ts'),
|
||||
'utf8',
|
||||
);
|
||||
assert.ok(serversSource.includes(':id/idle'));
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user