pull/3699/head
Woody 2024-01-16 22:38:01 +01:00
rodzic 04c3a925cc
commit e0f987328b
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 9872D7F5072789B2
1 zmienionych plików z 19 dodań i 0 usunięć

Wyświetl plik

@ -171,5 +171,24 @@ describe('General functionality', () => {
const currentTime = Date.now();
assert(currentTime - modifiedTime < 500, 'html_ui.h was not modified');
});
it('should rebuild if a inlined file changes', async () => {
// run script cdata.js and wait for it to finish
await execPromise('node tools/cdata.js');
// modify index.htm
fs.appendFileSync(path.join(dataPath, 'index.js'), ' ');
// delay for 1 second to ensure the modified time is different
await new Promise(resolve => setTimeout(resolve, 1000));
// run script cdata.js and wait for it to finish
await execPromise('node tools/cdata.js');
// check if html_ui.h was modified
const stats = fs.statSync(path.join(folderPath, 'html_ui.h'));
const modifiedTime = stats.mtimeMs;
const currentTime = Date.now();
assert(currentTime - modifiedTime < 500, 'html_ui.h was not modified');
});
});
});