this:
Run one Clojure test (not all tests in a namespace), with fixtures, from the REPL
works fine with repl, how can I do this from command line using Leinigen?
I am doing some Clojure pet project. I have some profiles like the following
{:test {:env {:database-name "library_test",
:host-name "192.168.33.10"
:username "library_admin"
…
I have seen many clojure projects that disable integration tests by default by adding this setting to project.clj:
:test-selectors {:default (complement :integration)
:integration :integration}
But, if a namespace contains only…
Is there a way to instrument the code and find out how much time each namespace takes or the only way forward is to use fixtures?
What is a good approach for solving such a problem?
I'm running into some issues with reporting on failures using the clojure.test testing framework.
Now, I understand that I can override some functions for different reporting so that it prints out to the console or wherever I want it to print to. I…
I am having a hard time creating a simple unit test in Clojure using with-redefs for mocking on Windows. The test code, the function I'm about to test and the function to be mocked are all in different namespaces/files:
Function under test:
(ns…
I have a function defined as:
(defn strict-get
[m key]
{:pre [(is (contains? m key))]}
(get m key))
And then I have a test for it:
(is (thrown? java.lang.AssertionError (strict-get {} :abc)))
However this test fails:
;; FAIL in ()…
Lein test runs my functions in random order.
I have two functions that modify the same data. I need the first one running first and the second one after that. The order in my test firles
Example:
;;===============my file=============
;;this fails…
The default output from clojure.test via lein test is pretty underwhelming:
Ran 1 tests containing 1 assertions.
0 failures, 0 errors.
I guess maybe Clojure people are minimalists, but in every other language I've used test runners use red/green…
The with-redefs function appears to be just what is needed to mock/stub out dependencies in clojure tests. I'm using clojure.test [1.10.1]
Initially it gave me a lot of grief, where the new bindings were not applied when I ran the test. Finally I…
I am trying to understand why my JUnit XML report results in an Incomplete status on AWS CodeBuild.
The XML is produced by Kaocha, a Clojure test runner, through its kaocha-junit-xml plugin.
At the end of my test run, the XML is generated and then…
I would like to build a jar file containing a suite of clojure.test tests, and then use lein test to run those tests. As far as I can tell, :test-paths only supports paths to test source, not test jars.
Is there a way to accomplish this?
I am attempting to replace the stacktrace-file-and-line (private) function in clojure.test, but using with-redefs-fn when running tests seems to have no effect. When I execute the following code the original stacktrace-file-and-line is called…
When I run a test in Spacemacs with Clojure mode via m t t it does not show a failure, even when the test clearly fails. See:
1 is not equal to 2, but still there are 0 test failures.
How can I make the test fail?
I’ve got a lein plugin that manually runs my clojure.test code. It declares a dynamic variable baseuri that I wish to access from within my tests. I’ll strip out and change the code to get straight to the point. Here, inside of my plugin, I have…