mirror of
https://github.com/PR0M3TH3AN/TORCH.git
synced 2026-10-27 07:51:52 +00:00
- Updated `build.mjs` to correctly source `TORCH.md` and `docs/` from the project root instead of the non-existent `src/docs/`. - Ensured `TORCH.md` is copied to `dist/src/docs/TORCH.md` as expected by the dashboard's fetch logic. - Added `test/build_verification.test.mjs` to prevent regressions by verifying the presence of critical build artifacts (`TORCH.md`, assets, dashboard). - Verified dashboard functionality (logos, settings modal) using a temporary Playwright script. Co-authored-by: PR0M3TH3AN <[email protected]>
35 lines
1.0 KiB
JavaScript
35 lines
1.0 KiB
JavaScript
import fs from 'fs';
|
|
import path from 'path';
|
|
import { test } from 'node:test';
|
|
import assert from 'node:assert';
|
|
|
|
const DIST_DIR = path.resolve('dist');
|
|
|
|
test('Build artifacts verification', async (t) => {
|
|
await t.test('dist directory exists', () => {
|
|
assert.strictEqual(fs.existsSync(DIST_DIR), true, 'dist directory should exist');
|
|
});
|
|
|
|
await t.test('Critical files exist in dist', () => {
|
|
const criticalFiles = [
|
|
'index.html',
|
|
'dashboard/index.html',
|
|
'src/docs/TORCH.md',
|
|
'assets/logo.svg',
|
|
'src/constants.mjs',
|
|
'src/prompts/META_PROMPTS.md'
|
|
];
|
|
|
|
criticalFiles.forEach(file => {
|
|
const filePath = path.join(DIST_DIR, file);
|
|
assert.strictEqual(fs.existsSync(filePath), true, `File ${file} should exist in dist`);
|
|
});
|
|
});
|
|
|
|
await t.test('TORCH.md content is not empty', () => {
|
|
const torchMdPath = path.join(DIST_DIR, 'src/docs/TORCH.md');
|
|
const content = fs.readFileSync(torchMdPath, 'utf8');
|
|
assert.ok(content.length > 0, 'TORCH.md should not be empty');
|
|
});
|
|
});
|