{"id":23086177,"url":"https://github.com/jakemcc/test-refresh","last_synced_at":"2026-04-09T20:01:52.679Z","repository":{"id":11548799,"uuid":"14034335","full_name":"jakemcc/test-refresh","owner":"jakemcc","description":"Refreshes and reruns clojure.tests in your project.","archived":false,"fork":false,"pushed_at":"2023-03-06T00:14:09.000Z","size":384,"stargazers_count":387,"open_issues_count":8,"forks_count":28,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-05-08T15:07:29.065Z","etag":null,"topics":["clojure","leiningen","test-tools","testing"],"latest_commit_sha":null,"homepage":null,"language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jakemcc.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2013-11-01T02:59:03.000Z","updated_at":"2024-06-19T01:50:21.356Z","dependencies_parsed_at":"2024-06-19T01:50:16.844Z","dependency_job_id":"cda8d1c5-b5a4-4462-841f-26d82db39f28","html_url":"https://github.com/jakemcc/test-refresh","commit_stats":null,"previous_names":["jakemcc/lein-test-refresh"],"tags_count":46,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jakemcc%2Ftest-refresh","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jakemcc%2Ftest-refresh/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jakemcc%2Ftest-refresh/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jakemcc%2Ftest-refresh/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jakemcc","download_url":"https://codeload.github.com/jakemcc/test-refresh/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247345854,"owners_count":20924102,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["clojure","leiningen","test-tools","testing"],"created_at":"2024-12-16T18:42:07.197Z","updated_at":"2025-12-12T01:18:19.895Z","avatar_url":"https://github.com/jakemcc.png","language":"Clojure","readme":"\u003e Like many Clojure projects, this is stable and doesn't require active maintenance. There might not be recent commits but it is still used and maintained.\n\n# test-refresh\n\nThis is a Clojure tool that notices when your source changes and then reloads your code and runs your `clojure.test` tests.\nIt works with Leiningen and `deps.edn` based projects.\n\nIt also works with [expectations](https://github.com/clojure-expectations/expectations) [clojure.test compatible syntax](https://clojure-expectations.github.io/clojure-test.html).\n\n## Features\n\n- Enables quick feedback cycles by automatically refreshing your code and running your tests.\n- Runs previously failing tests first, giving you feedback even quicker.\n- Built-in test-selector, `:test-refresh/focus`, that lets you narrow the scope of your testing without restarting `test-refresh`. A different selector can be overridden through configuration. See the sample project.clj or documentation in this README for more details.\n- Optionally only automatically runs tests in changed namespaces.\n- Can pass result of running your tests to a notification command of your choice.\n- Has built in Growl notification support.\n- Can be configured to only notify you on failures.\n- Times how long it takes to run your tests.\n- Can optionally suppress `clojure.test`'s _Testing namespace_ output. This is extremely useful in making test output with larger codebases readable again.\n- You can hit `enter` in terminal to force tests to rerun.\n- Supports `clojure.test`'s custom reports.\n- Supports running your tests once! Useful for taking advantage of custom test reporters or quiet output in CI systems.\n- Has optional repl support for changing global state, such as timbre logging levels\n- Detects if your project uses [circleci.test](https://github.com/circleci/circleci.test) and uses that instead of clojure.test.\n- **Leiningen only**: [Supports](https://github.com/jakemcc/test-refresh/blob/master/CHANGES.md#040) subset of Leiningen test selectors.\n- Supports clearing output between test runs, see [PR](https://github.com/jakemcc/test-refresh/pull/91) and sample configuration files for details.\n- Supports [custom banner](https://github.com/jakemcc/test-refresh/pull/91) printed between test runs. See sample configuration files.\n- Supports reloading and not running tests. See [PR](https://github.com/jakemcc/test-refresh/pull/91) motivation.\n\n[sample.project.clj](sample.project.clj) show optional Leininen configuration.\n[example.test-refresh.edn](example.test-refresh.edn) shows configuration options available to `deps.edn` based projects.\n\nThe sample configuration files and the rest of this documentation show how `test-refresh` can be used.\n\n## Usage\n\n### Leiningen based projects\n\nSee [docs/leiningen.md](docs/leiningen.md).\n\n### deps.edn based projects\n\nSee [docs/deps_edn.md](docs/deps_edn.md).\n\n## Features\n\n\u003e Any command line example here that is `lein test-refresh :some-argument` is **only** supported by Leiningen.\n\u003e deps.edn usage must be configured through `.test-refresh.edn` files.\n\n### Hit `Enter` to rerun tests\n\nIf you need to rerun your tests without changing a file then hit `Enter` when focused on a running `test-refresh`.\nThis behavior will stop if test-refresh thinks it has read till the end of STDIN.\nThis is usually caused by hitting ctrl-d, but also when a specific version of bash is invoked by test-refresh which can happen when running tests or notify commands.\n\n### Built-in test narrowing (test selector)\n\nHave you ever been running all of your tests and then want to only focus on one? \nInstead of commenting out the others or quitting test-refresh and restarting with a test-selector you can add `:test-refresh/focused true` to your test(s) or namespace.\n\nWith the below code, only `test-addition` will run until the `:test-refresh/focus` marker is removed from it.\n\n```clojure\n(deftest ^:test-refresh/focus test-addition\n  (is (= 2 (+ 1 1))))\n\n(deftest test-subtraction\n  (is (= 0 (- 10 9 1))))\n```\n\nYou can optionally specify a shorter flag by adding `:focus-flag :your-flag` to test-refresh's configuration.\n\n## Configuration Features\n\nA [sample.project.clj](sample.project.clj) contains the definitive example of configuring `test-refresh` features.\nConfiguration can appear in any file that Leiningen uses to merge into your project's configuration when running commands.\nOften `test-refresh` configuration is a personal preference and should be configured in your personal `~/.lein/profiles.clj`.\n\n### Notifications\n\n`test-refresh` supports specifying a notification command.\nThis command is passed a short message after your tests have run.\nThis command is configured through your `project.clj` or `profiles.clj`.\nFor example, if you want to send OSX notifications using [terminal-notifier](https://github.com/alloy/terminal-notifier) then you would add the following to your `project.clj` or `profiles.clj`\n\n```clojure\n:test-refresh {:notify-command [\"terminal-notifier\" \"-title\" \"Tests\" \"-message\"]}\n```\n\n`test-refresh` also has built-in Growl support.\nTo receive Growl notifications run `lein test-refresh :growl`.\nThis has been tested with modern (well, asof 2016) versions of Growl for [OS X](http://growl.info/), [Linux](http://mattn.github.com/growl-for-linux/), and [Windows](http://growlforwindows.com/). \nYou can also always set this to true by setting `:test-refresh {:growl true}}`.\nAn example can be found in the [sample project.clj](sample.project.clj).\n\n`:notify-on-success` is another available option.\nIt can be used to turn off notifications when your tests are successful.\nSet `:notify-on-success false` to turn off success notifications. \nAn example can be found in the [sample project.clj](sample.project.clj).\n\n### Reduced terminal output\n\n`test-refresh` can be configured to suppress `clojure.test`'s _Testing namespace_ output.\nAdd `:quiet true` to your `:test-refresh` configuration map to suppress `clojure.test`'s noisy output.\nThis is particularly useful on codebases with a large number of test namespaces.\n\n### Only run changes in changed namespaces.\n\n`test-refresh` can be configured to only automatically run tests in changed namespaces.\nThis can be used to get even faster feedback since only tests where something has changed will be run. \nYou can toggle this mode by adding a `:changes-only true` entry in your `:test-refresh` configuration or by passing it as a command line option `lein test-refresh :changes-only`.\n\nIf you are in this mode and want to run all your tests you can trigger them by hitting `enter` in the terminal where `test-refresh` is running.\n\n### Custom Clojure.test report\n\n`test-refresh` can be configured to use a custom `clojure.test` output report. \nAdd `:report myreport.namespace/myreport` to your `:test-refresh` configuration map to use your own reporter for `clojure.test`'s output.\nAn example can be found in the [sample project.clj](sample.project.clj).\n\n### Running your tests once\n\nAt first this seems like a weird feature for a refreshing test runner to support but because of the other features `test-refresh` supports, such as custom test runners, being able to just run tests once can be useful.\nSee [this](https://github.com/jakemcc/test-refresh/pull/48) pull request for discussion.\n\nYou can either configure this option in your project.clj (or profiles.clj) or pass it as a command line option.\nCheck out `sample.project.clj` for an example of project configuration.\n\nUsing it at the command line looks like `lein test-refresh :run-once`.\n\n### Running with a REPL\n\n`test-refresh` can be run with `:with-repl` which will start up a repl\nthat you can interact with in between test runs.\nThe main reason for this option is that sometimes you want to affect global state in your application.\nAn example is when you see a test failure, you can call `(taoensso.timbre/set-level! :debug)` and see more information.\n\nSee [this](https://github.com/jakemcc/test-refresh/pull/50) pull request for details.\n\n### Running in a REPL\n\n`test-refresh` supports running in a repl.\nThis was done to support running in Cursive's repl so [users could click](https://github.com/jakemcc/test-refresh/issues/80) and navigate to source.\n\nTo use this feature, add `test-refresh` as a project dependency instead of as a plugin.\nThen open your repl and do the following\n\n```clojure\nuser=\u003e (require 'com.jakemccrary.test-refresh)\nnil\nuser=\u003e (com.jakemccrary.test-refresh/run-in-repl \"test\")\n*********************************************\n*************** Running tests ***************\n```\n\nThe tests will run until you kill the evaluation with ctrl-c. \n\nThis feature is one I never use myself.\nI'd consider it experimental.\nIn my very limited testing I've had some weird behavior where I couldn't get it to stop running.\nI'm putting it out there though so others can use it.\n\n## Contributing\n\nI encourage pull requests.\nIf you're making a large change it is probably a good idea to create an issue and run it by me first.\nIf you open a pull request you should expect me to review the code and potentially suggest improvements.\nThis review might not happen quickly.\n\nWorking on `test-refresh` can be a bit tricky.\nDespite being a tool to enhance testing it has very few tests itself.\nAs a result its sort of a pain to work on.\nMy typical work flow is outlined below.\nI encourage you to do the following as well (or better yet, add some useful tests!).\n\n1. Open two terminals, one in the `./test-refresh` directory and one in `./lein2`.\n1. In `./test-refresh` run `lein install` to put a version built from your local `test-refresh` checkout into your `~/.m2` directory.\n1. The project in `./lein2` is setup to use whatever version is specified in `./test-refresh/project.clj`. As a result it will use the recently `lein install`ed version from the above step. Use the project in `./lein2` to test out your local version of `test-refresh`. Toggle settings in `./lein/project.clj` to test various features. Make tests fail and pass.\n1. Make your changes to the project in `./test-refresh` and `lein install`.\n1. Repeat manual testing in `./lein2`. Add sample code or configuration to `./lein2` project to show your changes.\n1. Don't forget about the deps.edn support. Sample project in `deps.edn` directory.\n\nMost changes and additions belong in the `test-refresh` directory so they will be shared by the Leiningen plugin (`lein-test-refresh`) and use in deps.edn projects.\nIf you need to make changes to the Leiningen plugin, edit code in `lein-test-refresh` and do a similar `lein install` as mentioned above for `test-refresh`.\n\nIts a bit painful but it works.\nIf there were more active changes happening to the project I'd invest the time to figure out how to test it but given the stability of `test-refresh` I haven't bothered.\nThey would be a welcome addition.\n\n## Latest version \u0026 Change log\n\nThe latest version is the highest non-snapshot version found in [CHANGES.md](CHANGES.md) or whatever the below images says (sometimes image doesn't seem to load).\n\n### Leiningen\n\n![Latest version](https://clojars.org/com.jakemccrary/lein-test-refresh/latest-version.svg)\n\n### deps.edn\n\n![Latest version](https://clojars.org/com.jakemccrary/test-refresh/latest-version.svg)\n\n## Compatibility\n\nlein-test-refresh has been tested to work with Clojure 1.5.1, 1.6, and\n1.7, 1.8, 1.9 with Leiningen 2.3+.\n\nBecause of [tools.namespace](https://github.com/clojure/tools.namespace) changes `test-refresh` requires that your project use Clojure \u003e= 1.3.0.\nIf your project also depends on a version of `tools.namespace` \u003c 0.2.1 you may see occasional exceptions.\n\n## Leiningen 1.0\n\nIf you are using Leiningen 1 this project is definitely broken starting on lein-test-refresh version 0.21.0.\nTry using 0.20.0 or earlier.\nThese versions were not explicitly tested with Leiningen 1 but they probably work.\nLeiningen 1 is not officially supported.\n\n## License\n\nCopyright (C) [Jake McCrary](https://jakemccrary.com)\n\nDistributed under the Eclipse Public License, the same as Clojure.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjakemcc%2Ftest-refresh","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjakemcc%2Ftest-refresh","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjakemcc%2Ftest-refresh/lists"}