Liking cljdoc? Tell your friends :D

scicloj.note-to-test.v1.api


define-value-representation!clj

(define-value-representation! name spec)

Define a data representation for special values. Outputs in test code will be represented this way.

For example, let us add support for tech.ml.dataset datasets, that we will use through Tablecloth.

(require '[tablecloth.api :as tc])
(note-to-test/define-value-representation!
  "tech.ml.dataset dataset"
  {:predicate tc/dataset?
   :representation (fn [ds]
                     `(tc/dataset ~(-> ds
                                       (update-vals vec)
                                       (->> (into {})))))})
Define a data representation for special values. Outputs in test code will be represented this way.

For example, let us add support for [tech.ml.dataset](https://github.com/techascent/tech.ml.dataset) datasets, that we will use through [Tablecloth](https://scicloj.github.io/tablecloth/).
```clj
(require '[tablecloth.api :as tc])
(note-to-test/define-value-representation!
  "tech.ml.dataset dataset"
  {:predicate tc/dataset?
   :representation (fn [ds]
                     `(tc/dataset ~(-> ds
                                       (update-vals vec)
                                       (->> (into {})))))})
```
raw docstring

gentest!clj

(gentest! source-path)

Generate a clojure.test file for the code examples in the file at source-path.

Example:

(gentest! "notebooks/dum/dummy.clj")
Generate a clojure.test file for the code examples in the file at `source-path`.

Example:
```clj
(gentest! "notebooks/dum/dummy.clj")
```
raw docstring

gentests!clj

(gentests! dirs)
(gentests! dirs options)

Generate tests for all source files discovered in [dirs].

Generate tests for all source files discovered in [dirs].
raw docstring

represent-valueclj

(represent-value v)

Represent a given value v using the extensible definitions of special value representations.

Represent a given value `v` using the extensible definitions of special value representations.
raw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close