@davoodmehraban89 / LifeMate / commits / 1a76078
Fork 0

LifeMate — Personal, Family & Learning Companion

feat(qa): prepare isolated GitHub Pages static build without Railway

davoodmehraban89 committed Oct 15, 2026 at 08:23 UTC 1a76078698a972f04af54a930d75442575b36eae
1 file changed +28
backend/tests/github_pages_qa.test.js new
+28
@@ -0,0 +1,28 @@
1 +import test from 'node:test';
2 +import assert from 'node:assert/strict';
3 +import { readFile } from 'node:fs/promises';
4 +const read = path => readFile(new URL(path, import.meta.url), 'utf8');
5 +
6 +test('LifeGuide GitHub Pages QA build reuses checked Flutter bundle without credentials', async () => {
7 + const script = await read('../../scripts/build-github-pages-qa.sh');
8 + assert.match(script, /bash scripts\/build-cloudflare-pages-qa\.sh/);
9 + assert.match(script, /touch "\$out\/\.nojekyll"/);
10 + assert.match(script, /config\.apiBaseUrl !== '\/api'/);
11 + assert.match(script, /config\.apiFallbackUrls\.length !== 0/);
12 + assert.match(script, /<base href="\/">/);
13 + assert.match(script, /site-check\.txt/);
14 + assert.doesNotMatch(script,/KAVENEGAR_API_KEY|DATABASE_URL|SUPABASE_SERVICE_ROLE_KEY|\.up\.railway\.app/);
15 +});
16 +
17 +test('GitHub Pages workflow deploys only after configured Pages action approval', async () => {
18 + const workflow = await read('../../.github/workflows/lifeguide-github-pages-qa.yml');
19 + assert.match(workflow,/infra\/lifeguide-github-pages-qa/);
20 + assert.match(workflow,/scripts\/build-github-pages-qa\.sh/);
21 + assert.match(workflow,/actions\/configure-pages@v5/);
22 + assert.match(workflow,/actions\/upload-pages-artifact@v4/);
23 + assert.match(workflow,/actions\/deploy-pages@v4/);
24 + assert.match(workflow,/pages: write/);
25 + assert.match(workflow,/id-token: write/);
26 + assert.match(workflow,/github-pages/);
27 + assert.doesNotMatch(workflow,/main\]|deployment-static|KAVENEGAR_API_KEY|DATABASE_URL|SUPABASE_SERVICE_ROLE_KEY/);
28 +});