Crossplatform async BDD style testing framework with commandline tool and gruntjs integration.

To install, run:

haxelib install bdd 0.9.0 

See using Haxelib in Haxelib documentation for more information.

BDDStyle (like RSpec or Jasmine)

because old school unit tests are boring :)

The main purpose for this framework is the continuous testing as small effort as can be.

I think writing tests before the actual code is written is a good think, but I'm lazy as hell and if its require some effort... then it has a high chance I will don't do it :)


Command Line Tool
- project initializer
- class creator
- [Gruntjs]( integration
- seamless OpenFL support
- test runner with grep and reporter setter
- headless javascript testing with phantomjs or nodejs
- automatic setup with project initializer
- terminal output colorization
- watch/exec tasks realtime created so can be change anytime
- grep and reporter option passtrough
- grep value can be setted based on the changed file so
  anytime a class or its test is edited only these tests will be run
- livereload for js and swf watch tasks
   - nested 'describe' and 'before/afterEach' sections
   - async blocks inside 'it'-s
   - modular reporting system
   - available platforms: all
       - except php:
           - builtin Sys.print generate wrong code...
           - cannot identify iterable objects like other platforms
       - C# / java: I don't know how to compile so not tested
Available shoulds:
should.success();;;;'foo', 'foo');[]);'foo', ['foo', 'bar']);'bar', ['foo', 'bar']);, 'foobar', ['foo', 'foobar', 'bar']);, 10);, 1.5);, 1, 1.5);, 1.49, 0.015);'foo');;;;'foo');{});{});;, new TestCase());

should.have.length(2, ['foo', 'bar']);'foo', {'foo': true});['foo', 'bar'], {'foo': true, 'bar':true});

should.match('fo\\w', 'foo');
should.startWith('f', 'foo');
should.endWith('o', 'foo');

should.contains('foo', ['foo', 'bar']);

should.throws(function(){ throw 'foo'; });

//and of course everything can be negated.;; :D

//checkout the tests for more detailed possibilities


$> haxelib install bdd
Command line:
$> haxelib run bdd init # it will ask some questions
Woud you like to use gruntjs as automatic/colorizer runner?
test path (default test):
source path (default src):
export path (default build):
haxelibs (other then bdd (commasep list)):
# if you enter openfl then the project file will be an openfl xml
# instead of hxml, and does not ask for the platforms
Which platforms would you like to use (default neko)?

$> haxelib run bdd test # compile and run all the platforms
                        # or neko with openfl
$> haxelib run bdd test -p cpp # only cpp target (both openfl/hxml)
$> haxelib run bdd create org.example.Whatever # create a class and
                                               # its test file
$> haxelib run bdd help # for more info :)
$> grunt watch:neko # run all the test files on file change with neko
$> grunt watch:phantomjs --grep=Example # only Example with phantom js
$> grunt watch:neko --reporter=dot --changed # only the changed file
                                             # with dot reporter
$> grunt watch:js # this will only build the js file and trigger for livereload
$> grunt help # for more info
4 years ago

All libraries are free

Every month, more than 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!

Join us on Github!

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

Haxe on Github