diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 632473a..f8cd71b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,7 +15,7 @@ jobs: - name: Setup Node.js uses: actions/setup-node@v4 with: - node-version: 20 + node-version: 22 cache: npm cache-dependency-path: portal/package-lock.json @@ -34,7 +34,7 @@ jobs: - name: Setup Node.js uses: actions/setup-node@v4 with: - node-version: 20 + node-version: 22 cache: npm cache-dependency-path: portal/package-lock.json @@ -91,7 +91,7 @@ jobs: - name: Setup Node.js uses: actions/setup-node@v4 with: - node-version: 20 + node-version: 22 cache: npm cache-dependency-path: portal/frontend/package-lock.json @@ -110,7 +110,7 @@ jobs: - name: Setup Node.js uses: actions/setup-node@v4 with: - node-version: 20 + node-version: 22 cache: npm cache-dependency-path: portal/frontend/package-lock.json diff --git a/portal/tests/app.test.js b/portal/tests/app.test.js index 1ae28bc..6316f2a 100644 --- a/portal/tests/app.test.js +++ b/portal/tests/app.test.js @@ -1,12 +1,30 @@ 'use strict'; +const fs = require('fs'); +const path = require('path'); const request = require('supertest'); const app = require('../server'); const db = require('../lib/db'); +const publicIndex = path.join(__dirname, '..', 'public', 'index.html'); +const frontendIndex = path.join(__dirname, '..', 'frontend', 'index.html'); +let wroteStubIndex = false; + describe('app integration', () => { beforeAll(async () => { await db.initStorage(); + // public/index.html es artefacto de Vite (gitignored); el job test no lo genera. + if (!fs.existsSync(publicIndex)) { + fs.mkdirSync(path.dirname(publicIndex), { recursive: true }); + fs.copyFileSync(frontendIndex, publicIndex); + wroteStubIndex = true; + } + }); + + afterAll(() => { + if (wroteStubIndex && fs.existsSync(publicIndex)) { + fs.unlinkSync(publicIndex); + } }); test('flujo completo: crear → descargar → completar', async () => {