Skip to content

What's new in midje 1.6

Mykhailo "Michael" Pershyn edited this page May 19, 2014 · 19 revisions
  • autotest can take file arguments (Joseph Wilk)

    The :dirs option is deprecated, replaced by :files or :file. The arguments can be files or directories.

    (autotest :file "test/midje/t_repl.clj")
    (autotest :files "test/midje/t_repl.clj" "src/midje")
  • JUnit/XML style output (Joseph Wilk)

    By putting:

    (change-defaults :emitter 'midje.emission.plugins.junit 
                     :print-level :print-facts 
                     :colorize false)

    in a config file, you get the style of XML output traditionally associated with JUnit. It's supported by various continuous integration servers.

    Output doesn't go to the screen. It's put in a target/surefire-reports/TEST-modulename.xml file in the root of your project.

    There are still glitches around Junit output. See the issues.

  • TAP output (Giorgio Valoti)

    By putting:

    (change-defaults :emitter 'midje.emission.plugins.tap 
                     :print-level :print-facts 
                     :colorize false)

    in a config file, you get TAP-format output. In contrast to the JUnit format, output goes to standard out. (Which is better?)

  • a progress-meter style of reporting (Joseph Wilk)

    By setting the :emitter config option to 'midje.emission.plugins.progress, you get "dot style" output:

    .........FFFF.FFFF.FFF..FP...................
    

    Periods mean success, "F" means failure, and "P" represents a future fact.

    After the tests are run, the normal failure messages and summary are printed.

  • Optional arguments in prerequisites (Joseph Wilk)

    If you don't care about arguments at the end of the argument list, you can do this:

    (fact 
        (find-letter) => ..letter-result..
        (provided
          (letter "x" & anything) => ..letter-result..))

    The value after the & is compared to the remaining arguments using extended equality. Therefore, you can do this:

    (fact
      (find-letter) => ..letter-result..
      (provided
        (letter & (contains ["x" "y"])) => ..letter-result..))
  • Setting colorize via .midje.clj config (Joseph Wilk)

    You can turn off color used in the terminal output by setting "colorize" in your .midje.clj config. You can also still use the ENV variable MIDJE_COLORIZE=false or MIDJE_COLORIZE=true. The environment always takes precedent.

    (change-defaults :colorize false)
    (change-defaults :colorize reverse)
  • Colorizing works in nrepl and cider (Colin Jones, Bozhidar Batsov)

  • Autotest works in nrepl and cider (Colin Jones)

  • A variety of improvements around error reporting and autotest

Clone this wiki locally