mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-03-30 06:12:06 -07:00
24 lines
979 B
TypeScript
24 lines
979 B
TypeScript
import assert from 'node:assert/strict';
|
|
import test from 'node:test';
|
|
import { composeStatsStartupRuntime } from './stats-startup-composer';
|
|
|
|
test('composeStatsStartupRuntime returns stats startup handlers', async () => {
|
|
const composed = composeStatsStartupRuntime({
|
|
ensureStatsServerStarted: () => 'http://127.0.0.1:8766',
|
|
ensureBackgroundStatsServerStarted: () => ({
|
|
url: 'http://127.0.0.1:8766',
|
|
runningInCurrentProcess: true,
|
|
}),
|
|
stopBackgroundStatsServer: async () => ({ ok: true, stale: false }),
|
|
ensureImmersionTrackerStarted: () => {},
|
|
});
|
|
|
|
assert.equal(composed.ensureStatsServerStarted(), 'http://127.0.0.1:8766');
|
|
assert.deepEqual(composed.ensureBackgroundStatsServerStarted(), {
|
|
url: 'http://127.0.0.1:8766',
|
|
runningInCurrentProcess: true,
|
|
});
|
|
assert.deepEqual(await composed.stopBackgroundStatsServer(), { ok: true, stale: false });
|
|
assert.equal(typeof composed.ensureImmersionTrackerStarted, 'function');
|
|
});
|