We use Mocha test framework, Chai assertion library and Faker.js for generating fake/random data to test each function of the API; These tests cover most use cases but there are no tests for EveryPay predefined scenarios which is a future TODO.
WARNING: Run tests only in the sandbox environment (https://sandbox-api.everypay.gr)
WARNING: The tests will create users/cards/payments to the sandbox environment that API keys belong to.
To run the tests, you first have to clone the repo:
git clone https://github.com/clytras/everypay.git && cd everypay
Then install all dependencies by running npm install
or yarn
to the project root directory.
You have to set environment variables using .env
file (see installation).
Then run npm run test
or yarn test
:
If you don't setup environment variables properly, you'll get a message and all tests will be skipped: