For AI agents: the complete documentation index is available at https://rstest.rs/llms.txt, the full documentation bundle is available at https://rstest.rs/llms-full.txt, and this page is available as Markdown at https://rstest.rs/config/test/snapshot-format.md.
close
  • English
  • snapshotFormat

    • Type: Omit<PrettyFormatOptions, 'plugins' | 'compareKeys'>
    • Default: { printShadowRoot: false }

    Customize snapshot serialization using options from pretty-format. plugins and compareKeys are omitted because snapshot format options must be serializable across worker boundaries.

    Rstest omits shadow roots from snapshots by default. Set printShadowRoot to true to include them.

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