Skip to content

Latest commit

 

History

History
32 lines (18 loc) · 1.54 KB

README-en.md

File metadata and controls

32 lines (18 loc) · 1.54 KB

⚡ Tests ⚡

Dependencies

To perform and document our API tests, we install the dependencies:

You can follow the tutorial of the Medium, but basically we installed them as follows:

Run the command: yarn add jest supertest. Or if you prefer npm: npm install jest supertest

How to run tests

Configuring

  • Make a copy of the file .env.sample from the root of the project, and rename this copy to .env.test.
  • Then configure the file according to your needs and preferences.

Starting testing

  • Once configured, we need to create the database and enter its records for constraints. To do this, run the command: yarn pre-test.
  • With the bank created and the records already entered, we can already run the tests with the: yarn test.

Remember:

We set in package.json that with each run of the yarn test he recreated the test database by running the yarn pre-test before the test command. This is important because tests follow a pace already set to test all requests.

If you want to change this option, modify the "test" script of package.json