Skip to content

Commit

Permalink
✅ Clean up test suite by removing unnecessary code
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelcolmenares committed Jun 13, 2024
1 parent 938fcf1 commit dbe8ab8
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/test/extension.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
Expand Down Expand Up @@ -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]);
});
});

Expand All @@ -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]);
});
});

Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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]);
}
});

0 comments on commit dbe8ab8

Please sign in to comment.