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.
(add-expected-value! file-path line expected-value)Add or update the expected value in a snap! call.
Arguments:
Returns:
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 - expected-value: The value to insert as expected 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
(find-all-snap!-calls file-path)Find all snap! calls in a file.
Returns a sequence of maps with:
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)
(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.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |