Files
oh-my-pi/packages/utils/test/fixtures/logger-api-probe.ts
T
usr-bin-roygbiv 54e3a9f156 test(utils): define lean logger contract
(cherry picked from commit 4ded69a293827e0dfbc3333f3da2944c97d71016)
2026-07-29 23:08:27 +02:00

16 lines
537 B
TypeScript

import * as fs from "node:fs";
import { logger as rootLogger } from "../../src/index";
import * as directLogger from "../../src/logger";
const outputPath = process.argv[2];
if (!outputPath) throw new Error("expected output path");
const keys = Object.keys(directLogger).sort();
const identities = keys.every(key => {
const direct = directLogger as Record<string, unknown>;
const root = rootLogger as Record<string, unknown>;
return direct[key] === root[key];
});
fs.writeFileSync(outputPath, JSON.stringify({ identities, keys }));