Prove a sezioni: il file di una prova conta solo per la prova che lo esegue (un cambio in browser.mjs non fa rifare ambient o veicoli); test

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GiECd9RWGMKV7n3K1mdy8T
This commit is contained in:
2026-11-01 15:13:37 +01:00
co-authored by Claude Opus 5.5
parent 37bfe4e15e
commit 4afac814ee
2 changed files with 5 additions and 2 deletions
+3 -1
View File
@@ -61,7 +61,9 @@ export function inputsOf(name, files) {
const s = SUITES[name], live = files.filter(p => !ignored(p)); const s = SUITES[name], live = files.filter(p => !ignored(p));
if (!s.core) return [...new Set([...ENGINE.filter(p => files.includes(p)), ...ownFiles(name, live)])].sort(); if (!s.core) return [...new Set([...ENGINE.filter(p => files.includes(p)), ...ownFiles(name, live)])].sort();
const others = Object.keys(SUITES).filter(n => !SUITES[n].core); const others = Object.keys(SUITES).filter(n => !SUITES[n].core);
const foreign = new Set(others.flatMap(n => ownFiles(n, live))); // I file degli altri minigiochi, e i file di prova delle altre prove (tests/ambient.browser.mjs non riguarda la partita).
const foreign = new Set([...others.flatMap(n => ownFiles(n, live)),
...Object.keys(SUITES).filter(n => SUITES[n].run[0] !== s.run[0]).map(n => SUITES[n].run[0])]);
return live.filter(p => !foreign.has(p)).sort(); return live.filter(p => !foreign.has(p)).sort();
} }
export const fingerprint = (paths, hashOf) => createHash('sha1').update(paths.map(p => `${p} ${hashOf(p)}`).join('\n')).digest('hex'); export const fingerprint = (paths, hashOf) => createHash('sha1').update(paths.map(p => `${p} ${hashOf(p)}`).join('\n')).digest('hex');
+2 -1
View File
@@ -39,7 +39,8 @@ test('la briscola si riprova solo se cambia la briscola o il motore', () => {
}); });
test('la storia, le scene, i minigiochi dentro la partita e un modulo nuovo fanno rifare la partita intera, non i minigiochi a sé', () => { test('la storia, le scene, i minigiochi dentro la partita e un modulo nuovo fanno rifare la partita intera, non i minigiochi a sé', () => {
for (const path of ['src/story/story.js', 'src/story/solution.js', 'assets/scenes/piazza.png', 'src/engine/bocce.js', 'src/engine/ambient.js', 'src/engine/nuovo.js', 'tests/browser.mjs']) { assert.deepEqual(suitesWith('tests/browser.mjs'), ['principale', 'minigiochi', 'telefoni'], 'il file di una prova conta solo per lei');
for (const path of ['src/story/story.js', 'src/story/solution.js', 'assets/scenes/piazza.png', 'src/engine/bocce.js', 'src/engine/ambient.js', 'src/engine/nuovo.js']) {
assert.deepEqual(suitesWith(path), cores, path); assert.deepEqual(suitesWith(path), cores, path);
} }
}); });