Skip to content

Commit

Permalink
chore: use expand from CLI
Browse files Browse the repository at this point in the history
  • Loading branch information
sheremet-va committed Nov 4, 2023
1 parent b870b00 commit 686e265
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/vitest/src/node/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ export function resolveConfig(

const UPDATE_SNAPSHOT = resolved.update || process.env.UPDATE_SNAPSHOT
resolved.snapshotOptions = {
expand: resolved.expandSnapshotDiff ?? false,
snapshotFormat: resolved.snapshotFormat || {},
updateSnapshot: (isCI && !UPDATE_SNAPSHOT)
? 'none'
Expand Down
5 changes: 5 additions & 0 deletions packages/vitest/src/types/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -711,6 +711,11 @@ export interface UserConfig extends InlineConfig {
* @example --shard=2/3
*/
shard?: string

/**
* Show full diff when snapshot fails instead of a patch.
*/
expandSnapshotDiff?: boolean
}

export interface ResolvedConfig extends Omit<Required<UserConfig>, 'config' | 'filters' | 'browser' | 'coverage' | 'testNamePattern' | 'related' | 'api' | 'reporters' | 'resolveSnapshotPath' | 'benchmark' | 'shard' | 'cache' | 'sequence' | 'typecheck' | 'runner' | 'poolOptions' | 'pool'> {
Expand Down

0 comments on commit 686e265

Please sign in to comment.