autotest

Extract all *Tests.hx files and execute them as buddy test suites
https://github.com/kLabz/autotest

To install, run:

haxelib install autotest 0.1.0 

See using Haxelib in Haxelib documentation for more information.

README.md

AutoTest

AutoTest is a lib for use with buddy, allowing you to have test suites anywhere in your project and not having to maintain a "root test suite" referencing them all.

It works by gathering all files ending with Tests.hx in your sources (but not your libs nor haxe std) and adding them to a buddy suite used as main.

AutoTest declares -main itself, do not add it to your test.hxml.

Specific behavior

Enzyme integration

When used with enzyme, it will initialize Jsdom and React16Adapter in the main class __init__. This cannot be disabled atm but could become configurable if needed.

Redux test coverage (experimental)

When used with redux and -D redux_test_coverage, AutoTest will add a new test suite at the end, trying to make sure you test some specific things, by naively checking if each of these classes have a corresponding XTests.hx file beside it. It will not check that this is a proper test suite (this would fail at tests compile-time anyway), nor that this test suite is complete in any way.

You can configure the packages (as directories) it should be looking into with the following compilation flags:

  • -D redux_reducer_pack, default value being store/reducer
  • -D redux_middleware_pack, default value being store/middleware
  • -D redux_thunk_pack, default value being store/thunk
  • -D redux_selector_pack, default value being store/selector

Example output:

[... see previous example output ...]
Tests coverage
  All 1 middlewares should have test suites (FAILED)
    No test suite for: MyMiddleware
  All 1 reducers should have test suites (Passed)
  All 1 selectors should have test suites (Passed)
  All 1 thunks should have test suites (Passed)
17 specs, 1 failures, 0 pending
Contributors
klabz
Version
0.1.0
Published
7 years ago
Dependencies
License
MIT

All libraries are free

Every month, more than a thousand developers use Haxelib to find, share, and reuse code — and assemble it in powerful new ways. Enjoy Haxe; It is great!

Explore Haxe

Haxe Manual

Haxe Code Cookbook

Haxe API documentation

You can try Haxe in the browser! try.haxe.org

Join us on GitHub!

Haxe is being developed on GitHub. Feel free to contribute or report issues to our projects.

Haxe on GitHub