practicalli / practicalli/clojure

Defining tests in function meta data

Open
#27 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

testing
Dominant language
Makefile
Stars
117
Forks
36
PR merge metrics
No merged PRs in 30d

Description

you can define your tests inside the meta data of a function, are there any pitfalls to doing this as a kind of documentation?

clojure.test is doing similar inside of deftest macro. You can also use clojure.test/test-var to execute your tests in the context of clojure.test

https://gist.github.com/DeLaGuardo/55ae4be5a932cf32b0f1e828e5109bb6

run it

clj -Sdeps '{:deps {some {:git/url "git@gist.github.com:55ae4be5a932cf32b0f1e828e5109bb6.git" :sha "87da16f6ec05b7dcfa4f28590eed0894c3a2ddbf"}}}'

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked gist and run it using the provided clj -Sdeps command. Read the references to clojure.test/deftest and clojure.test/test-var, then determine whether the project wants a defined approach for tests in function metadata and what pitfalls or completion criteria should be documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
clojure
Domain
testing
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.