0
Fork 0
mirror of https://github.com/verdaccio/verdaccio.git synced 2024-12-16 21:56:25 -05:00

chore: add supertest link

This commit is contained in:
Juan Picado @jotadeveloper 2019-07-27 13:01:58 +02:00
parent 851cacf5af
commit 54e62fbb53
No known key found for this signature in database
GPG key ID: 15AA875EF3768142

View file

@ -2,7 +2,7 @@
Welcome to the testing folder at Verdaccio. This document aims to help you understand how Verdaccio should be tested.
First of all, we should explain the testing frameworks being used. We use `jest` and other tools such as `supertest` to be able to test the API, and `puppeteer` for End-to-End testing.
First of all, we should explain the testing frameworks being used. We use `jest` and other tools such as **`supertest`** to be able to test the API, and **`puppeteer`** for End-to-End testing.
### Before getting started
@ -114,6 +114,8 @@ test('should fetch jquery package from remote uplink', (done) => {
In the previous example, we are fetching `jquery` metadata from our server, we can define custom headers, expect some specific status and validate the body outcome.
> For more information about the **supertest** API, please [read their website](https://www.npmjs.com/package/supertest).
The `mockRegistry = await mockServer(mockServerPort).init();` mock registry will be used as `uplink` for the `app` object described above, **this is optional**, but, the most of the tests are using this approach for increase the number of tested scenarios.
The *mock server* has a static storage which is located `test/unit/partials/mock-store`, if you need add new packages, those must be commited in such folder. **Any modification in the mock server might affect other test, since is a shared context**.