Initial import of zappier-edge from zapier monorepo

This commit is contained in:
George Lambert 2026-09-11 13:50:46 -04:00
commit f0d193b221
120 changed files with 19867 additions and 0 deletions

21
tests/paths.test.ts Normal file
View file

@ -0,0 +1,21 @@
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);
});
});