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,
      },
    });