Skip to content

Conversation

@9aoy
Copy link
Contributor

@9aoy 9aoy commented Sep 30, 2025

Summary

Support customize the snapshot format via snapshotFormat option.

import { defineConfig } from '@rstest/core';

export default defineConfig({
  snapshotFormat: {
    printBasicPrototype: true,
  },
});

Related Links

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

Copilot AI review requested due to automatic review settings September 30, 2025 03:09
@netlify
Copy link

netlify bot commented Sep 30, 2025

Deploy Preview for rstest-dev ready!

Name Link
🔨 Latest commit 032b910
🔍 Latest deploy log https://app.netlify.com/projects/rstest-dev/deploys/68db49ee9c59840008b7c31f
😎 Deploy Preview https://deploy-preview-609--rstest-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds support for customizing snapshot formatting through a new snapshotFormat configuration option. Users can now configure snapshot output formatting using options from the pretty-format library.

  • Adds snapshotFormat configuration option to RstestConfig interface
  • Integrates snapshotFormat into the worker runtime and snapshot generation pipeline
  • Includes comprehensive documentation in both English and Chinese

Reviewed Changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated no comments.

Show a summary per file
File Description
packages/core/src/types/config.ts Adds SnapshotFormat type definition and snapshotFormat property to RstestConfig
packages/core/src/config.ts Sets default empty object for snapshotFormat in createDefaultConfig
packages/core/src/types/worker.ts Adds snapshotFormat to RuntimeConfig and WorkerState types
packages/core/src/pool/index.ts Includes snapshotFormat in getRuntimeConfig function
packages/core/src/runtime/worker/index.ts Passes snapshotFormat to worker snapshotOptions
website/docs/en/config/test/snapshotFormat.mdx Adds English documentation for snapshotFormat option
website/docs/zh/config/test/snapshotFormat.mdx Adds Chinese documentation for snapshotFormat option
website/docs/*/config/test/_meta.json Updates navigation metadata to include snapshotFormat
website/theme/components/ConfigOverview.tsx Adds snapshotFormat to configuration overview
e2e/snapshot/fixtures/* Adds end-to-end tests for snapshotFormat functionality
packages/core/tests/**/*.snap Updates test snapshots to include snapshotFormat in output

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@9aoy 9aoy merged commit 1967be1 into main Sep 30, 2025
17 checks passed
@9aoy 9aoy deleted the snapshotFormat branch September 30, 2025 03:13
@9aoy 9aoy mentioned this pull request Sep 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant