master-zapier-plan-draft/packages/zappier/tests/paths.test.ts
George Lambert b4150c8250 Milestone 0: import zappier billing, Verae middleware, and Zapier research
Compose-ready workspace: packages/zappier (rate card, portal, Stripe),
packages/verae-zapier-middleware (timestamp + NATS), packages/verae-zapier
(CLI app), vendor/zapier-platform, and research/zapier vendor corpus.

Gate 0 structure checks pass. Product code and research are not yet wired.
2026-09-09 02:37:36 -04:00

21 lines
839 B
TypeScript

import fs from 'fs';
import path from 'path';
import { PROJECT_ROOT } from '../src/paths';
// The server must work from any working directory (systemd, Docker, cron,
// `node dist/index.js` launched from elsewhere), so every runtime path is
// resolved from PROJECT_ROOT rather than process.cwd().
describe('PROJECT_ROOT', () => {
it('points at the project root regardless of cwd', () => {
expect(path.isAbsolute(PROJECT_ROOT)).toBe(true);
expect(fs.existsSync(path.join(PROJECT_ROOT, 'package.json'))).toBe(true);
});
it('resolves the OpenAPI spec served at /docs', () => {
expect(fs.existsSync(path.join(PROJECT_ROOT, 'openapi.yaml'))).toBe(true);
});
it('resolves the admin static assets served at /admin', () => {
expect(fs.existsSync(path.join(PROJECT_ROOT, 'admin', 'index.html'))).toBe(true);
});
});