master-zapier-plan-draft/packages/zappier-accounting-export/test/health.test.js
George Lambert a1a5b957fd
Some checks are pending
offline / test (push) Waiting to run
Wire zappier-edge into the live stack and add billing department APIs
Fleet now spawns the real zappier and middleware processes. Metered
timestamp/receipt/hash calls proxy to middleware when ZAPPIER_UPSTREAM
is set. CS credits, sales per-customer pricing, and QuickBooks export
are separate repos plugged into zappier-edge admin.
2026-09-11 15:15:55 -04:00

23 lines
745 B
JavaScript

import { test } from 'node:test';
import assert from 'node:assert/strict';
import { spawn } from 'node:child_process';
import { fileURLToPath } from 'node:url';
import path from 'node:path';
const root = path.join(path.dirname(fileURLToPath(import.meta.url)), '..');
test('accounting-export health', async () => {
const port = 18013;
const child = spawn(process.execPath, ['src/server.js'], {
cwd: root,
env: { ...process.env, PORT: String(port) },
stdio: ['ignore', 'pipe', 'pipe'],
});
await new Promise((r) => setTimeout(r, 400));
try {
const r = await fetch(`http://127.0.0.1:${port}/health`);
assert.equal((await r.json()).role, 'zappier-accounting-export');
} finally {
child.kill('SIGTERM');
}
});