diff --git a/scripts/verify.mjs b/scripts/verify.mjs index 98e7455..b672603 100644 --- a/scripts/verify.mjs +++ b/scripts/verify.mjs @@ -16,10 +16,10 @@ import { cpus } from 'node:os'; // Il motore comune a tutto: cambia questo e si riprova ogni minigioco. export const ENGINE = ['index.html', 'style.css', 'src/main.js', 'src/engine/game.js', 'src/engine/render.js', - 'tests/helpers.mjs', 'package-lock.json', 'scripts/verify.mjs']; + 'tests/helpers.mjs', 'package-lock.json']; // Non toccano il gioco nel browser: documenti, strumenti, pubblicazione, versione (make bump la cambia prima di verificare), -// test unitari (girano sempre, a parte). -export const IGNORED = [/^docs\//, /^[^/]*\.md$/, /^src\/version\.js$/, /^package\.json$/, /^Makefile$/, /^scripts\/(?!verify\.mjs)/, +// test unitari (girano sempre, a parte), e questo stesso script (lo prova verify.test.mjs). +export const IGNORED = [/^docs\//, /^[^/]*\.md$/, /^src\/version\.js$/, /^package\.json$/, /^Makefile$/, /^scripts\//, /^tools\//, /^video\//, /^\.gitea\//, /^prompts\//, /^LICENSE$/, /^Dockerfile$/, /^nginx\.conf$/, /^docker-compose/, /^requirements\.txt$/, /^\.(gitignore|dockerignore|verify-ok\.json)$/, /^tests\/[^/]*\.test\.mjs$/, /^tests\/test_[^/]*\.py$/, /^deploy\.local\.mk$/, /(^|\/)__pycache__\//]; @@ -116,7 +116,7 @@ async function main() { const green = Object.keys(SUITES).filter(n => !todo.some(t => t.name === n)); if (!todo.length) { console.log(`Prove nel browser: tutte verdi dall'ultimo giro (${green.length}); niente da rifare.`); return; } for (const t of todo) { - const why = all ? 'tutte' : named.includes(t.name) ? 'chiesta' : !ok[t.name] ? 'mai provata' : `cambiati ${t.changed.slice(0, 4).join(', ')}${t.changed.length > 4 ? ` e altri ${t.changed.length - 4}` : ''}`; + const why = all ? 'tutte' : named.includes(t.name) ? 'chiesta' : !ok[t.name] ? 'mai provata' : !t.changed.length ? "cambiato l'elenco dei file da cui dipende" : `cambiati ${t.changed.slice(0, 4).join(', ')}${t.changed.length > 4 ? ` e altri ${t.changed.length - 4}` : ''}`; console.log(`da rifare: ${t.name}${t.seconds ? ` (~${t.seconds} s)` : ''}: ${why}`); } if (green.length) console.log(`giĆ  verdi: ${green.join(', ')}`); diff --git a/tests/verify.test.mjs b/tests/verify.test.mjs index 872811a..7c78bfb 100644 --- a/tests/verify.test.mjs +++ b/tests/verify.test.mjs @@ -50,7 +50,7 @@ test('il motore comune fa rifare tutto', () => { }); test('versione, package.json, Makefile, documenti, strumenti e test unitari non fanno rifare niente', () => { - for (const path of ['src/version.js', 'package.json', 'Makefile', 'README.md', 'docs/STATO.md', 'scripts/bump.sh', 'tools/slice_sprites.py', 'tests/briscola.test.mjs', 'tests/story.test.mjs', '.verify-ok.json']) { + for (const path of ['src/version.js', 'package.json', 'Makefile', 'README.md', 'docs/STATO.md', 'scripts/bump.sh', 'scripts/verify.mjs', 'tools/slice_sprites.py', 'tests/briscola.test.mjs', 'tests/story.test.mjs', '.verify-ok.json']) { assert.ok(ignored(path), `${path} dovrebbe essere ignorato`); assert.deepEqual(suitesWith(path), [], path); }