Skip to content

isSnapshotEnabled

isSnapshotEnabled(tags) applies the tag rule of Automatic snapshots. visAnnotations calls it for every story.

import { isSnapshotEnabled } from 'storybook-addon-vis'
isSnapshotEnabled(['snapshot']) // true
isSnapshotEnabled(['snapshot', '!snapshot']) // false
isSnapshotEnabled(['!snapshot', 'snapshot']) // true
isSnapshotEnabled([]) // false
function isSnapshotEnabled(tags: string[]): boolean
  • With neither snapshot nor !snapshot in the tags, the result is false.
  • Otherwise the tag that appears last wins.