Skip to content
Snippets Groups Projects
Commit 103dd94f authored by Ryan Senior's avatar Ryan Senior
Browse files

Add a test helper function for test scaffolding cleanup

This is of most use at the REPL when you want to invoke a
function (such as expectations/run-tests) and have the test
scaffolding available and cleanup after itself.
parent 6c689ee4
No related branches found
No related tags found
No related merge requests found
......@@ -99,3 +99,17 @@
[]
(log/info "Shutting down Metabase unit test runner")
(core/stop-jetty!))
(defn call-with-test-scaffolding
"Runs `test-startup` and ensures `test-teardown` is always
called. This function is useful for running a test (or test
namespace) at the repl with the appropriate environment setup for
the test to pass."
[f]
(try
(test-startup)
(f)
(catch Exception e
(throw e))
(finally
(test-teardown))))
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment