mirror of
https://github.com/hanzoai/vitest.git
synced 2026-10-30 14:46:34 +00:00
17 lines
362 B
TypeScript
17 lines
362 B
TypeScript
import { SnapshotSerializer } from 'vitest'
|
|
|
|
export default {
|
|
serialize(val, config, indentation, depth, refs, printer) {
|
|
return `Pretty bar: ${printer(
|
|
val.bar,
|
|
config,
|
|
indentation,
|
|
depth,
|
|
refs,
|
|
)}`
|
|
},
|
|
test(val) {
|
|
return val && Object.prototype.hasOwnProperty.call(val, 'bar')
|
|
},
|
|
} satisfies SnapshotSerializer
|