An xUnit testing framework for Hack
xUnit written in Hack, for Hack
xUnit testing framework written in Facebook's language, Hack
Built against HHVM nightly.
HackUnit can be run using
bin/hackunit or if installed via composer -
bin/hackunit [--hackunit-file="..."] [--exclude="..."] [path]
Hackunit.php file is included before tests are run. You can specify the path to this file with the
--hackunit-file switch, or HackUnit will look in the current working directory for one.
Currently the only way to exclude paths from the HackUnit loader is to specify a space delimited list at the command line:
bin/hackunit --exclude="/path/to/ExcludedTest.php /path/to/many/tests/"
Currently HackUnit follows a convention for loading tests. Test case files must end in the
Test.hh extension - i.e
Only methods beginning with the word
test will be considered for execution by the loader (although this may change soon)
The goal of HackUnit is to write a testing framework using Hack's strict mode. HackUnit itself is tested with HackUnit.
Top level code must use a hack mode of
//partial and certain functions like
exit require the use of
//UNSAFE. These requirements may change as Hack evolves.
From the project directory run this:
bin/hackunit --exclude Tests/Fixtures/ Tests/