Skip to content

Commit

Permalink
Code: コメントを追加
Browse files Browse the repository at this point in the history
  • Loading branch information
sevenc-nanashi authored Dec 3, 2024
1 parent c2a076c commit 96d61c1
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions tests/e2e/storybook/スクリーンショット.spec.mts
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
// 起動中のStorybookで様々なStoryを表示し、スクリーンショットを撮って比較するVRT。
// テスト自体はend-to-endではないが、Playwrightを使う関係でe2eディレクトリ内でテストしている。
/*
* 起動中のStorybookで様々なStoryを表示し、スクリーンショットを撮って比較するVRT。
* テスト自体はend-to-endではないが、Playwrightを使う関係でe2eディレクトリ内でテストしている。
*
* --update-snapshotsをつけてPlaywrightを実行するとスクリーンショットが更新される。
* 同時に、Storyが消えたスクリーンショットの削除も行う。
*/
import fs from "fs/promises";
import path from "path";
import { test, expect, Locator } from "@playwright/test";
Expand Down Expand Up @@ -132,6 +137,7 @@ test("スクリーンショットの一覧に過不足が無い", async () => {
for (const screenshot of screenshotPaths) {
if (!expectedScreenshots.includes(screenshot)) {
await fs.unlink(screenshot);
console.log(`Deleted: ${path.basename(screenshot)}`);
}
}
} else {
Expand Down

0 comments on commit 96d61c1

Please sign in to comment.