Initial import of zappier-edge from zapier monorepo
This commit is contained in:
commit
78e6201d43
120 changed files with 19867 additions and 0 deletions
21
tests/paths.test.ts
Normal file
21
tests/paths.test.ts
Normal 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);
|
||||
});
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue