From ddfe925f8c737689c4f78bb568c91d1545d8de38 Mon Sep 17 00:00:00 2001 From: Woody Date: Wed, 17 Jan 2024 21:15:46 +0100 Subject: [PATCH] rename test --- tools/cdata-test.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/tools/cdata-test.js b/tools/cdata-test.js index f4dbf6878..55f068073 100644 --- a/tools/cdata-test.js +++ b/tools/cdata-test.js @@ -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(); });