Skip to content

Releases: NoahTheDuke/lazytest

v1.5.0

26 Nov 20:28
Compare
Choose a tag to compare
  • Add defexpect and expecting to lazytest.extensions.expectations. Reduce code generated by expectations/expect, pass metadata through all generated code to make line numbers match correctly.

v1.4.1

21 Nov 18:29
Compare
Choose a tag to compare

Fixed

  • around context macro is now called once for all children. (See #12.)
  • Update Expectations v2 port to allow for easier updating in the future and support all non-test definition functions/macros. (See #10 and #11.)

Misc

  • Added .editorconfig

v1.4.0

19 Nov 22:04
Compare
Choose a tag to compare

Added

  • Can now pass in paths as cli arguments, not just through repeated --dir flags: clojure -M:dev:test test/unit test/integration will look for tests in both test/unit and test/integration.
  • Documentation in docs/core.md and in the lazytest.core docstring.
  • Exclude lazytest.core/defdescribe from :clojure-lsp/unused-public-var linter.

Changed

  • Removed Malli dependency as it's no longer used.
  • Support doc tests where the expected value is a function:
(+ 1 1)
=> int?

is rewritten as (expect (int? (+ 1 1))).

  • Give lazytest.core/throws-with-msg? and lazytest.core/causes-with-msg? better errors when the class matches but the regex doesn't.
  • Switch from :test metadata to :lazytest/test metadata. It's longer, but it no longer clashes with clojure.test's internals so you can run lazytest over clojure.test tests without them being marked as passing tests. (See #4.)
  • Clarify :output and :reporter: :output is from the CLI or from a caller of the lazytest.repl functions, and :reporter is the function created/referenced from :output.
  • Move namespace filtering to lazytest.filter/filter-tree and out of lazytest.main.

Fixed

  • cljdoc links in README.md. (See #1.)

v1.3.0

21 Oct 17:02
Compare
Choose a tag to compare

Added

  • Add support for Expectations v2 in lazytest.extensions.expectations. Only ports over expect and related helpers.
  • Add rudimentary test-doc support, which allows for specifying markdown files to parse and treat as tests for the purposes of test runs.
  • --md FILE is how to specify markdown files to parse and treat as Lazytest tests.

v1.2.0

16 Oct 14:01
Compare
Choose a tag to compare

Wrote better documentation for lazytest.core, highlighting the primary vars and their use cases.

Added generic support for skipping test cases or suites with :skip metadata.

(describe "many cases"
  (it "will be skipped"
    {:skip true}
    (expect (= 1 2)))
  (it "will be ran"
    (expect (= 1 1))))

Added

  • lazytest.runner/run-test-suite: For running a suite value instead of running a namespace or a var.
  • lazytest.core/update-children: An intended-for-internal-use function useful in defining suites and test-cases.
  • Support :skip metadata on suites and test-cases.

Changed

  • lazytest.core/it and lazytest.core/expect-it return nil if within *context*.
  • lazytest.experimental.interfaces.midje/fact no longer wraps it in a describe.
  • lazytest.core/defdescribe ignores *context*, allowing it to be nested.

v1.1.1

09 Oct 20:04
Compare
Choose a tag to compare

Fixed

  • Added the lazytest.core aliases to the readme.
  • Added a note about the experimental to the readme.
  • Hide some of the helper functions from the docs.

v1.1.0

09 Oct 19:34
Compare
Choose a tag to compare

Features

  • Add 4 "interfaces", namespaces of alternative top-level vars to define test suites and test cases: clojure.test, Midje, QUnit, and xUnit. This allows for writing tests in a more comfortable API while still using Lazytest's machinery. See each namespace's docstring for further details.
  • Add popular aliases for lazytest.core vars:
    • describe -> context
    • it -> specify
    • expect -> should

Fixed

  • Change documentation from :lazytest/suite to :lazytest/ns-suite for namespace-defined suites.
  • Clean up reporters checking types instead of :type.

v1.0.0

03 Oct 14:28
Compare
Choose a tag to compare

Released 2024-10-03.

Changes

  • Rewrite internals to use nested maps instead of nested sequences and functions. Suites (and :lazytest/runs and :lazytest/nses) have :children, which can be other suites or test cases.
  • Deprecated given in favor of let.
  • Changed primary branch from master to main.
  • Disconnected Github fork from original Lazytest repo.

Features

  • Add macros before and after, and support :context in suite metadata. This allows for writing fixture-like code that can be reused across multiple suites or tests:
(defdescribe context-test
  (let [state (volatile! [])]
    (describe "it runs both"
      {:context [(before (vswap! state conj :before))
                 (after (vswap! state conj :after))]}
      (expect-it "temp" true))
    (expect-it "tracks correctly"
      (= [:before :after] @state))))
  • Add the macro around, which works like a clojure.test fixture:
(describe "it works"
  {:context [(around [f]
               (binding [*foo* 100]
                 (f)))]}
  ...)
  • Add macros before-each and after-each, which are run before/after each nested test case.
  • Add function set-ns-context! which sets the current namespace's context to be the given vector. Works like clojure.test/use-fixture.

v0.5.0

21 Sep 02:38
Compare
Choose a tag to compare

Released 2024-09-20.

Features

  • --watch cli flag will run under "Watch mode", which uses clj-reload to check for changes in local classpath, and then reruns the provided or default test suite. Includes --delay NUM which allows for changing the number of milliseconds between checking changes.

v0.4.2

21 Sep 02:37
Compare
Choose a tag to compare

Released 2024-08-28.

  • Target java 11 as unnecessary to target later versions.