From 7d36aba4ddfb32e6dde1581e012bebf6789a710a Mon Sep 17 00:00:00 2001 From: alicechai Date: Tue, 13 Feb 2024 22:40:38 +0700 Subject: [PATCH] fix: cosmetics --- .../typhon/typhon-wallet-download.spec.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/wallet-automation/typhon/typhon-wallet-download.spec.ts b/tests/wallet-automation/typhon/typhon-wallet-download.spec.ts index acaf23bdde..af5f6ba357 100644 --- a/tests/wallet-automation/typhon/typhon-wallet-download.spec.ts +++ b/tests/wallet-automation/typhon/typhon-wallet-download.spec.ts @@ -6,15 +6,15 @@ const url = 'https://clients2.google.com/service/update2/crx?response=redirect&o const downloadPath = path.resolve(__dirname, 'extensions'); test('downloadFile test', async ({ page }) => { - // Ensure the download directory exists + // ensure the download directory exists await fs.mkdir(downloadPath, { recursive: true }); - // Preemptively set up to handle the download + // preemptively set up to handle the download const downloadPromise = new Promise(async (resolve) => { page.once('download', async (download) => { const filePath = path.join(downloadPath, download.suggestedFilename()); await download.saveAs(filePath); - console.log(`File has been downloaded to: ${filePath}`); + console.log(`file has been downloaded to: ${filePath}`); resolve(filePath); }); }); @@ -28,16 +28,16 @@ test('downloadFile test', async ({ page }) => { console.log('navigation caused an exception, likely due to immediate download:', 'directDownload'); } - // Wait for the download to complete + // wait for the download to complete const downloadedFilePath = await downloadPromise; - // Verify the file exists + // verify the file exists try { await fs.access(downloadedFilePath); // Corrected the variable name here - console.log('File verification succeeded, file exists.'); + console.log('file verification succeeded, file exists.'); } catch { - console.error('File verification failed, file does not exist.'); - throw new Error('Downloaded file does not exist.'); + console.error('file verification failed, file does not exist.'); + throw new Error('downloaded file does not exist.'); }; });