From dbe8ab84c085514f92b8f2fdc1e03755d41658e9 Mon Sep 17 00:00:00 2001 From: Miguel Colmenares Date: Wed, 12 Jun 2024 19:16:04 -0500 Subject: [PATCH] =?UTF-8?q?=E2=9C=85=20Clean=20up=20test=20suite=20by=20re?= =?UTF-8?q?moving=20unnecessary=20code?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/test/extension.test.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/test/extension.test.ts b/src/test/extension.test.ts index a1095a6..99358fc 100644 --- a/src/test/extension.test.ts +++ b/src/test/extension.test.ts @@ -27,6 +27,13 @@ suite("JS & CSS Minifier Test Suite", async function () { } } + this.afterAll(async function () { + const cssUri = vscode.Uri.file(path.join(__dirname, "fixtures", "test.css")); + const jsUri = vscode.Uri.file(path.join(__dirname, "fixtures", "test.js")); + await deleteGeneratedFiles(cssUri, prefixes); + await deleteGeneratedFiles(jsUri, prefixes); + }); + // Test for minifying a CSS file test("Minify CSS file", async function () { const cssUri = vscode.Uri.file(path.join(__dirname, "fixtures", "test.css")); @@ -59,7 +66,6 @@ suite("JS & CSS Minifier Test Suite", async function () { const newDocument = await vscode.workspace.openTextDocument(newFileUri); const minifiedContent = newDocument.getText(); assert.strictEqual(minifiedContent, cssMinifiedContent); - await deleteGeneratedFiles(cssUri, [prefix]); }); }); @@ -74,7 +80,6 @@ suite("JS & CSS Minifier Test Suite", async function () { const newDocument = await vscode.workspace.openTextDocument(newFileUri); const minifiedContent = newDocument.getText(); assert.strictEqual(minifiedContent, jsMinifiedContent); - await deleteGeneratedFiles(jsUri, [prefix]); }); }); @@ -89,7 +94,6 @@ suite("JS & CSS Minifier Test Suite", async function () { const newDocument = await vscode.workspace.openTextDocument(newFileUri); const minifiedContent = newDocument.getText(); assert.strictEqual(minifiedContent, cssMinifiedContent); - await deleteGeneratedFiles(cssUri, [prefix]); }); // Test for minifying a JS file and saving it with the configured prefix @@ -103,7 +107,6 @@ suite("JS & CSS Minifier Test Suite", async function () { const newDocument = await vscode.workspace.openTextDocument(newFileUri); const minifiedContent = newDocument.getText(); assert.strictEqual(minifiedContent, jsMinifiedContent); - await deleteGeneratedFiles(jsUri, [prefix]); }); // Test for minifying a CSS file and saving it as a new file from the explorer context menu @@ -183,6 +186,5 @@ suite("JS & CSS Minifier Test Suite", async function () { const newDocument = await vscode.workspace.openTextDocument(newFileUri); const minifiedContent = newDocument.getText(); assert.strictEqual(minifiedContent, expectedContent); - await deleteGeneratedFiles(newFileUri, [newFilePrefix]); } });