fix: test unitaire frontend — recherche.js exempté d'import/export (fichier vendangé #68)
This commit is contained in:
@@ -112,8 +112,10 @@ function testModulesHaveImports() {
|
|||||||
{ file: 'navfacets.js', reason: 'pure helpers — no deps, imported by vaulthome.js' },
|
{ file: 'navfacets.js', reason: 'pure helpers — no deps, imported by vaulthome.js' },
|
||||||
{ file: 'sidebar_raw.js', reason: 'legacy file — excluded' },
|
{ file: 'sidebar_raw.js', reason: 'legacy file — excluded' },
|
||||||
{ file: 'desktop.js', reason: 'standalone — reads window.__TAURI__ global, no imports needed' },
|
{ file: 'desktop.js', reason: 'standalone — reads window.__TAURI__ global, no imports needed' },
|
||||||
|
{ file: 'recherche.js', reason: 'standalone — vanilla sans dépendance, vendangé tel quel par chaque hôte (#68)', noExport: true },
|
||||||
];
|
];
|
||||||
const expectNoImport = new Set(expected.map(e => e.file));
|
const expectNoImport = new Set(expected.map(e => e.file));
|
||||||
|
const expectNoExport = new Set(expected.filter(e => e.noExport).map(e => e.file));
|
||||||
|
|
||||||
for (const file of files) {
|
for (const file of files) {
|
||||||
const content = readFileSync(join(JS_DIR, file), 'utf-8');
|
const content = readFileSync(join(JS_DIR, file), 'utf-8');
|
||||||
@@ -123,7 +125,7 @@ function testModulesHaveImports() {
|
|||||||
if (!expectNoImport.has(file)) {
|
if (!expectNoImport.has(file)) {
|
||||||
assert.ok(hasImport, `${file} should have at least one import`);
|
assert.ok(hasImport, `${file} should have at least one import`);
|
||||||
}
|
}
|
||||||
if (file !== 'state.js' && file !== 'app.js') {
|
if (file !== 'state.js' && file !== 'app.js' && !expectNoExport.has(file)) {
|
||||||
assert.ok(hasExport, `${file} should have at least one export`);
|
assert.ok(hasExport, `${file} should have at least one export`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user