Releases: NoahTheDuke/lazytest
Releases · NoahTheDuke/lazytest
v2.0.0
Big feature: Hooks! Or plugins, as they're sometimes called. These are entrypoints into the running state of lazytest, called on a given object (the config, the current suite, etc), that allow an author to inspect and/or update that object before it's evaluated or before it's returned. It should allow for better extensibility and configurability.
Added
- Add
around-eachcontext functions. (See #31, and PR #34 by @edenworky!) - Add
lazytest.hooksto support writing plugins/hooks that modify the run. - Write initial demonstration hooks,
profilingandrandomize.
Changed/Fixed
- Correct the order of
aroundandbefore-each/after-eachin test cases. (See #31.) - BREAKING: Change the order of context hook calls so that
aroundwrapsbeforeandafter. There are very few use cases where this will matter, so I am not too worried about it. - Fix
expect-itto handle:contextin the attr-map. - Change the config object to use
:reporters, not:reporter. - Add clj-kondo hook for
lazytest.hooks/defhook. - Change documentation (readme, docstrings) to use
contextinstead ofhookforbefore/after/etc.
v1.9.1
- Reverted change to JVM target, back to 11.
v1.9.0
- Support
lazytest/describe=foo-barin clojure markdown blocks for doctests. The string will be used as thedefdescribe's var name instead of a gensym based on the current header. - Support doctests in babashka.
- BREAKING: Internally change
expectto throw aclojure.lang.ExceptionInfowith:type :lazytest/expectation-failed.lazytest.ExpectationFailedwill be kept in the jar forever, but it won't work as a target forcatchanymore if you're using it. This is to make it easier to use Lazytest incljcfiles and to support porting lazytest to other dialects in the future.
If you're currently usinglazytest.ExpectationFailed, may I recommend using sinker or ex to ease catching such exceptions. - Make
--watchwork with doctests that set aliases (generally through(require foo :as bar)). - Bump
clj-reloadto 1.0.0 to support--watchin babashka. - Bump JVM target to 17, in anticipation of Clojure 1.13.
v1.8.0
Added
- Babashka support! Currently doesn't support
:watch, and due to lack of custom classes,ExpectationFailedis anex-info, not a properExpectationFailed. This complicates writingcatchclauses, asExpectationFailedis anAssertionError, not anExceptionInfo, but with the help of the new predicate functionex-failed?, catchingThrowableand checking is simple enough (if a little unweildy).
Changed
- Removed trailing newline from
summaryreporter. Looked weird to have an additional line after running.
Chores
- Updated
splintto latest, set configuration appropriately, and fixed all diagnostics. - Updated all dependencies to latest.
v1.7.0
Added
- Add a new "interface" for Expectations v2, under
lazytest.experimental.interfaces.expectations, adaptingdefexpectandexpecting, and re-exporting the varsexpect,in,from-each,more,more-of, andmore->fromlazytest.extensions.expectations. - Correct Expectations reporting by prepending any
testingstrings to the assertion message. (See #22 by @seancorfield.)
Changed
- Deprecate "interface" vars from
lazytest.extensions.expectations:defexpect, andexpecting.
Misc
- Add
splintback to CI now that it supports Clojure 1.10. - Add test demonstrating intended output of nested contexts and
aroundcalls. (See #24.)
v1.6.1
Fixed
- Corrected deployment issues, switch to raw tools.build for the moment.
v1.6.0
Added
- Add
thrown?andthrown-with-msg?tolazytest.experimental.interfaces.clojure-test. (See #18)
Fixed
- Support Clojure 1.10. (See #17 by @seancorfield)
Misc
- Remove
splintfrom CI until Splint supports Clojure 1.10.
v1.5.0
- Add
defexpectandexpectingtolazytest.extensions.expectations. Reduce code generated byexpectations/expect, pass metadata through all generated code to make line numbers match correctly.
v1.4.1
v1.4.0
Added
- Can now pass in paths as cli arguments, not just through repeated
--dirflags:clojure -M:dev:test test/unit test/integrationwill look for tests in bothtest/unitandtest/integration. - Documentation in
docs/core.mdand in thelazytest.coredocstring. - Exclude
lazytest.core/defdescribefrom:clojure-lsp/unused-public-varlinter.
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?andlazytest.core/causes-with-msg?better errors when the class matches but the regex doesn't. - Switch from
:testmetadata to:lazytest/testmetadata. It's longer, but it no longer clashes withclojure.test's internals so you can run lazytest overclojure.testtests without them being marked as passing tests. (See #4.) - Clarify
:outputand:reporter::outputis from the CLI or from a caller of thelazytest.replfunctions, and:reporteris the function created/referenced from:output. - Move namespace filtering to
lazytest.filter/filter-treeand out oflazytest.main.
Fixed
- cljdoc links in README.md. (See #1.)