Skip to content

Commit

Permalink
fix: delete test user directory
Browse files Browse the repository at this point in the history
  • Loading branch information
makinzm committed Dec 22, 2024
1 parent 9bbe105 commit 907ce82
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/e2e/content_script.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
// tests/e2e/content_script.spec.ts
import { test, expect, chromium } from "@playwright/test";
import * as path from "path";
import * as fs from "fs";
import * as util from "util";

// 非同期でディレクトリを削除するためのユーティリティ
const rmdir = util.promisify(fs.rmdir);

test("Content script should create a button when selecting 'World' text if domein is included, then fail to create if domain is excluded", async () => {
// 拡張機能 dist フォルダへのパス
Expand Down Expand Up @@ -97,3 +102,12 @@ test("Content script should create a button when selecting 'World' text if domei
await context.close();
});


// テスト後にユーザーデータディレクトリを削除
test.afterAll(async () => {
const userDataDir = path.resolve(__dirname, "../../.tmp-user-data");
if (fs.existsSync(userDataDir)) {
await rmdir(userDataDir, { recursive: true });
console.log("Removed user data directory:", userDataDir);
}
})

0 comments on commit 907ce82

Please sign in to comment.