This is a helper package for writing tests that interact with the Wildduck API or other parts in some way. It exposes a test server script via the vendor/node_modules bin directory to easily link it with your NPM or Compose flows.
Note: Currently only supported on Mac and Linux. Windows support is coming.
This package relies on readlink -f
but Mac's default installed readlink
does not support the -f
option. Hence, coreutils
should be installed. Can be installed via MacPorts or Homebrew (brew install coreutils
).
Via NPM:
npm install --save-dev wildduck-test-server
Via Composer:
composer require --dev kurbar/wildduck-test-server
It can be used in different ways.
- As a standalone script NPM:
node_modules/bin/wildduck-test-server start|stop
Composer:
vendor/bin/wildduck-test-server start|stop
- Or tied into your package.json/composer.json flow NPM:
{
"scripts": {
"test:wd": "wildduck-test-server start && npm test && wildduck-test-server stop"
}
}
Composer (Note: it is recommended to disable process timeout since on first start it might take a while and Composer will time out executing):
{
"scripts": {
"test": [
"Composer\\Config::disableProcessTimeout",
"wildduck-test-server start",
"phpunit tests/",
"wildduck-test-server stop"
]
}
}