For AI agents: the complete documentation index is available at /zh/llms.txt, the full documentation bundle is available at /zh/llms-full.txt, and this page is available as Markdown at /zh/config/test/snapshot-format.md.
close
  • 简体中文
  • snapshotFormat

    • 类型: PrettyFormatOptions
    • 默认值: { printShadowRoot: false }

    使用 pretty-format 提供的选项自定义快照格式。

    Rstest 默认在快照中省略 Shadow Root。将 printShadowRoot 设置为 true 可在快照中包含它们。

    rstest.config.ts
    import { defineConfig } from '@rstest/core';
    
    export default defineConfig({
      snapshotFormat: {
        printBasicPrototype: true,
      },
    });