busted is the framework used for the unit tests.
Using Docker you just need to run:
make development
That will create a Docker container and run bash inside it. The project's source
code will be available in the container and sync'ed with your local apicast
directory, so you can edit files in your preferred environment and still be able
to run whatever you need inside the Docker container.
To install the dependencies inside the container run:
make dependencies
To run the unit tests inside the container:
make busted
To run a single file of tests
make busted BUSTED_FILES=path/to/file_spec.lua
To run a specific set of it
tests, i.e. a contextual description defined
by the describe
function, add some unique token, for instance ONLY
, to the describe
function.
describe("ONLY should be awesome", function()
then, add BUSTED_ARGS
with --filter
param
make busted BUSTED_FILES=path/to/file_spec.lua BUSTED_ARGS="--filter='ONLY'"