npm install --save-dev jest-preview
npx jest-preview
ブラウザが次のURLで自動的に開きます http://localhost:3336/
MyComponent.spec.tsx (デバッグしたいjestファイル)
import { debug } from "jest-preview"
// eslint-disable-next-line testing-library/no-debugging-utils
debug()
jest を実行する
npm run test MyComponent.spec.tsx
これだけでブラウザに画面が表示されます。 便利!