Liking cljdoc? Tell your friends :D

fulcro-spec.coverage

Registry for tracking which functions are covered by which tests.

This namespace provides the foundation for transitive test coverage proofs. Tests declare which functions they cover via the :covers metadata in the specification macro, and this registry tracks those declarations.

The :covers metadata is a map of {fn-symbol signature-string} where the signature is a short hash of the function's source code at the time the test was written/verified. This enables staleness detection when functions change.

Registry for tracking which functions are covered by which tests.

This namespace provides the foundation for transitive test coverage proofs.
Tests declare which functions they cover via the :covers metadata in the
specification macro, and this registry tracks those declarations.

The :covers metadata is a map of {fn-symbol signature-string} where the
signature is a short hash of the function's source code at the time the
test was written/verified. This enables staleness detection when functions
change.
raw docstring

fulcro-spec.instrument

Cross-platform instrumentation functions for mock validation. These wrap stub functions to validate args/return against Malli schemas or Clojure Specs.

Cross-platform instrumentation functions for mock validation.
These wrap stub functions to validate args/return against Malli schemas or Clojure Specs.
raw docstring

fulcro-spec.proof

Tools for verifying transitive test coverage proofs.

This namespace provides functions to verify that a function and all its transitive dependencies have declared test coverage. This enables building a provable chain of tests from low-level functions up to application logic.

Additionally, it supports staleness detection: when a function's source code changes after a test was sealed, the coverage is marked as stale until the developer reviews and re-seals the test.

Configuration: Configuration is automatically loaded from .fulcro-spec.edn in the project root when first needed. You can also use configure! to set options programmatically:

  • :scope-ns-prefixes - set of namespace prefix strings to include (e.g. #{"myapp"})
  • :enforce? - when true, when-mocking!! and provided!! will throw on missing coverage

Example .fulcro-spec.edn: {:scope-ns-prefixes #{"myapp" "myapp.lib"} :enforce? false}

Or programmatically: (proof/configure! {:scope-ns-prefixes #{"myapp"}})

Tools for verifying transitive test coverage proofs.

This namespace provides functions to verify that a function and all its
transitive dependencies have declared test coverage. This enables building
a provable chain of tests from low-level functions up to application logic.

Additionally, it supports staleness detection: when a function's source code
changes after a test was sealed, the coverage is marked as stale until the
developer reviews and re-seals the test.

Configuration:
Configuration is automatically loaded from `.fulcro-spec.edn` in the project root
when first needed. You can also use `configure!` to set options programmatically:

- :scope-ns-prefixes - set of namespace prefix strings to include (e.g. #{"myapp"})
- :enforce? - when true, when-mocking!! and provided!! will throw on missing coverage

Example .fulcro-spec.edn:
  {:scope-ns-prefixes #{"myapp" "myapp.lib"}
   :enforce? false}

Or programmatically:
  (proof/configure! {:scope-ns-prefixes #{"myapp"}})
raw docstring

fulcro-spec.signature

clj

On-demand signature computation and resealing for staleness detection.

Signatures are short hashes of normalized function source code. When a function's implementation changes, its signature changes, allowing detection of stale test coverage.

The signature is computed by:

  1. Extracting full source using clojure.repl/source-fn
  2. Removing docstrings (so doc changes don't invalidate tests)
  3. Normalizing whitespace (so formatting changes don't invalidate tests)
  4. Hashing with SHA-256 and taking first 6 characters

Signature format:

  • LEAF functions (no in-scope callees): Single-field "xxxxxx"
  • NON-LEAF functions: Two-field "xxxxxx,yyyyyy" where:
    • xxxxxx: 6-char hash of the function's own source
    • yyyyyy: 6-char hash of all transitive callees' signatures

The signature function automatically detects leaf vs non-leaf and returns the appropriate format. Use it for all signature needs.

Resealing (updating :covers signatures in source files):

  • reseal! updates signatures at a given file/line for IDE integration

IDE keybinding examples: Cursive: (fulcro-spec.signature/reseal! "$FilePath$" $LineNumber$) CIDER: (cider-interactive-eval (format "(fulcro-spec.signature/reseal! "%s" %d)" (buffer-file-name) (line-number-at-pos)))

Performance options (Java system properties):

  • fulcro-spec.auto-skip: Enable auto-skipping of already-checked tests
  • fulcro-spec.sigcache: Cache signatures for duration of JVM
On-demand signature computation and resealing for staleness detection.

Signatures are short hashes of normalized function source code.
When a function's implementation changes, its signature changes,
allowing detection of stale test coverage.

The signature is computed by:
1. Extracting full source using clojure.repl/source-fn
2. Removing docstrings (so doc changes don't invalidate tests)
3. Normalizing whitespace (so formatting changes don't invalidate tests)
4. Hashing with SHA-256 and taking first 6 characters

Signature format:
- LEAF functions (no in-scope callees): Single-field "xxxxxx"
- NON-LEAF functions: Two-field "xxxxxx,yyyyyy" where:
  - xxxxxx: 6-char hash of the function's own source
  - yyyyyy: 6-char hash of all transitive callees' signatures

The `signature` function automatically detects leaf vs non-leaf and
returns the appropriate format. Use it for all signature needs.

Resealing (updating :covers signatures in source files):
- `reseal!` updates signatures at a given file/line for IDE integration

IDE keybinding examples:
  Cursive: (fulcro-spec.signature/reseal! "$FilePath$" $LineNumber$)
  CIDER:   (cider-interactive-eval
            (format "(fulcro-spec.signature/reseal! \"%s\" %d)"
                    (buffer-file-name) (line-number-at-pos)))

Performance options (Java system properties):
- fulcro-spec.auto-skip: Enable auto-skipping of already-checked tests
- fulcro-spec.sigcache: Cache signatures for duration of JVM
cljs

Signatures are a CLJ-only feature. This is here for compilation of CLJC without issues.

Signatures are a CLJ-only feature. This is here for compilation of CLJC without issues.
raw 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