我如何摆脱重复的clojure测试 - 是对REPL的单元测试

时间:2021-12-16 22:47:19

I have a little script

我有一个小脚本

(use 
 :reload-all
 'com.example.package1
 'com.example.package2
 'com.example.package3
 'com.example.testlib)

(run-tests
 'com.example.package1
 'com.example.package2
 'com.example.package3)

that I use to quickly reload everything and fire off the unit tests.
trouble is that each time (deftest ... ) is evaluated as the files are read an additional test is created so after working hard all day each test is now being run 103 times, eek!

我用它来快速重新加载所有内容并启动单元测试。麻烦的是,每次(deftest ...)被评估为文件被读取,因此创建了一个额外的测试,所以在整天努力工作之后,每个测试现在正在运行103次,eek!

1 个解决方案

#1


There is a flag *load-tests* which determines the behaviour of deftest. (doc deftest) seems to implicate that setting this flag to false could solve your problem.

有一个标志* load-tests *决定了deftest的行为。 (doc deftest)似乎暗示将此标志设置为false可以解决您的问题。

#1


There is a flag *load-tests* which determines the behaviour of deftest. (doc deftest) seems to implicate that setting this flag to false could solve your problem.

有一个标志* load-tests *决定了deftest的行为。 (doc deftest)似乎暗示将此标志设置为false可以解决您的问题。