Liking cljdoc? Tell your friends :D

still.rewrite

Source code rewriting for snap! inline snapshots.

Uses rewrite-clj to parse, locate, and modify snap! calls in source files while preserving formatting and comments.

Source code rewriting for snap! inline snapshots.

Uses rewrite-clj to parse, locate, and modify snap! calls in source files
while preserving formatting and comments.
raw docstring

add-expected-value!clj

(add-expected-value! file-path line expected-value)
(add-expected-value! file-path line expected-value value-sig)

Add or update the expected value in a snap! call.

Arguments:

  • file-path: Absolute path to the source file
  • line: Line number of the snap! call (compile-time, pre-edit)
  • expected-value: The value to insert as expected
  • value-sig (optional): canonical string of the value expression, used to locate the call regardless of line drift. When omitted or nil, the call is located by line number alone.

Returns:

  • :updated if the expected value was updated
  • :inserted if a new expected value was inserted
  • :not-found if the snap! call wasn't found
  • :error if an error occurred
Add or update the expected value in a snap! call.

Arguments:
- file-path: Absolute path to the source file
- line: Line number of the snap! call (compile-time, pre-edit)
- expected-value: The value to insert as expected
- value-sig (optional): canonical string of the value expression, used to
  locate the call regardless of line drift. When omitted or nil, the call
  is located by line number alone.

Returns:
- :updated if the expected value was updated
- :inserted if a new expected value was inserted
- :not-found if the snap! call wasn't found
- :error if an error occurred
sourceraw docstring

find-all-snap!-callsclj

(find-all-snap!-calls file-path)

Find all snap! calls in a file.

Returns a sequence of maps with:

  • :line - Line number
  • :column - Column number
  • :has-expected? - Whether it has an expected value
  • :value - The value expression (as string)
  • :expected - The expected value expression (if present, as string)
Find all snap! calls in a file.

Returns a sequence of maps with:
- :line - Line number
- :column - Column number
- :has-expected? - Whether it has an expected value
- :value - The value expression (as string)
- :expected - The expected value expression (if present, as string)
sourceraw docstring

find-all-snap-callsclj

(find-all-snap-calls file-path)

Find all snap and snap! calls in a file.

Returns a sequence of maps:

  • {:type :snap :key <keyword> :line <n>} for snap calls (the :key entry is present when the first argument is a keyword literal)
  • {:type :snap! :line <n>} for snap! calls

Throws ex-info if the file cannot be parsed.

Find all snap and snap! calls in a file.

Returns a sequence of maps:
- {:type :snap :key <keyword> :line <n>} for snap calls (the :key entry is
  present when the first argument is a keyword literal)
- {:type :snap! :line <n>} for snap! calls

Throws ex-info if the file cannot be parsed.
sourceraw docstring

remove-expected-value!clj

(remove-expected-value! file-path line)

Remove the expected value from a snap! call.

This converts: (snap! value expected) to: (snap! value)

Useful for resetting a snapshot.

Remove the expected value from a snap! call.

This converts:
  (snap! value expected)
to:
  (snap! value)

Useful for resetting a snapshot.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close