轻松地调试 Jest 测试。
轻松地调试 Jest 测试。
在线尝试 Jest 预览。无需下载!
_使用 Vitest 吗? 请尝试 [Vitest 预览](https://github.com/nvh95/vitest-preview) ## 为什么使用 **jest-preview** 在使用 Jest 编写测试时,我们通常通过阅读 HTML 代码进行调试。有时,HTML 过于复杂,无法在脑中直观地呈现 UI。`jest-preview` 可在浏览器中预览您的 Jest 测试,然后您可以直观地看到实际的 UI,这有助于更快地编写和调试 Jest 测试。 - 在毫秒内在浏览器中预览实际应用的 HTML 代码。 - 执行 `preview.debug()` 时自动重新加载浏览器。 - 支持 CSS: - ✅ [直接导入 CSS](#3-configure-jests-transform-to-intercept-css-and-files) - ✅ 一些 CSS-in-JS 库,例如: - ✅ [Styled-components](https://styled-components.com/) - ✅ [Emotion](https://emotion.sh/) - ✅ [全局 CSS](https://www.jest-preview.com/docs/getting-started/installation#4-optional-configure-global-css) - ✅ [CSS 模块](https://github.com/css-modules/css-modules) - ✅暂无开放 Issues,或尚未同步最近议题。