AI Implementation feature(899): Data and run (#39)

This commit was merged in pull request #39.
This commit is contained in:
2026-07-22 19:56:33 +00:00
parent 113dd47371
commit 1a40e5708a
23 changed files with 305 additions and 53 deletions
+12
View File
@@ -6,6 +6,18 @@ describe('envSchema', () => {
expect(r.success).toBe(true);
});
it('defaults DATABASE_PATH to ./data/db.sqlite', () => {
const r = envSchema.safeParse({});
expect(r.success).toBe(true);
expect((r.data as any).DATABASE_PATH).toBe('./data/db.sqlite');
});
it('defaults UPLOAD_DIR to ./data/uploads', () => {
const r = envSchema.safeParse({});
expect(r.success).toBe(true);
expect((r.data as any).UPLOAD_DIR).toBe('./data/uploads');
});
it('rejects invalid PORT', () => {
const r = envSchema.safeParse({ PORT: 'not-a-number' });
expect(r.success).toBe(false);
+26
View File
@@ -0,0 +1,26 @@
import { readFileSync } from 'node:fs';
import * as path from 'node:path';
describe('Root dev script orchestration', () => {
it('exposes a `dev` script that runs both backend and frontend workspaces', () => {
const pkg = JSON.parse(
readFileSync(path.join(__dirname, '..', '..', 'package.json'), 'utf8'),
);
expect(typeof pkg.scripts?.dev).toBe('string');
expect(pkg.scripts.dev).toMatch(/workspace\s+backend/);
expect(pkg.scripts.dev).toMatch(/workspace\s+frontend/);
});
it('configures the Angular dev server to proxy /api and /uploads to the Nest backend', () => {
const angularJson = JSON.parse(
readFileSync(
path.join(__dirname, '..', '..', 'frontend', 'angular.json'),
'utf8',
),
);
const serve = angularJson.projects?.hipctf?.architect?.serve;
expect(serve).toBeDefined();
expect(typeof serve.options?.proxyConfig).toBe('string');
expect(serve.options.proxyConfig).toMatch(/proxy/);
});
});