rename test

This commit is contained in:
Woody 2024-01-17 21:15:46 +01:00
parent 1735bcab21
commit ddfe925f8c
No known key found for this signature in database
GPG Key ID: 9872D7F5072789B2

View File

@ -140,17 +140,15 @@ describe('Script', () => {
await runAndCheckIfBuiltFilesExist();
});
it('1 or more html_*.h files are missing', async () => {
it('only one html_*.h file is missing', async () => {
// run script cdata.js and wait for it to finish
await execPromise('node tools/cdata.js');
// delete a random html_*.h file
let files = await fs.promises.readdir(folderPath);
let htmlFiles = files.filter(file => file.startsWith('html_') && path.extname(file) === '.h');
if (htmlFiles.length > 0) {
const randomFile = htmlFiles[Math.floor(Math.random() * htmlFiles.length)];
await fs.promises.unlink(path.join(folderPath, randomFile));
}
const randomFile = htmlFiles[Math.floor(Math.random() * htmlFiles.length)];
await fs.promises.unlink(path.join(folderPath, randomFile));
await runAndCheckIfBuiltFilesExist();
});