gitbeaker/docs/TESTING.md
Justin Dalrymple 7f1648802b Major Release v36.0.0 - Improved Typing, and API support (16.0) (#2258)
Adding extensive typing support
Unified browser and Node.JS implementations
Adding support of Gitlab API 16.0
2023-04-26 12:58:56 -04:00

41 lines
909 B
Markdown

Testing is a work-in-progress right now but here is the start.
**Unit Tests**
Run:
```bash
yarn test:unit
```
**Integration Tests**
1. First, run Gitlab in a docker container:
```bash
docker-compose -f scripts/docker-compose.yml up
```
1. Once GitLab is up on localhost:8080, get the two environment variables from the docker image could
either export them into environment variables locally:
```bash
export PERSONAL_ACCESS_TOKEN=$(docker exec -it gitlab bash -lc 'printf "%q" "${PERSONAL_ACCESS_TOKEN}"')
export GITLAB_URL=$(docker exec -it gitlab bash -lc 'printf "%q" "${GITLAB_URL}"')
```
1. Now run the tests
```bash
yarn test:integration:node
```
You can also define them in front of the yarn script
```
PERSONAL_ACCESS_TOKEN='abcdefg' GITLAB_URL='http://localhost:8080' yarn test
```
> Note it may take about 3 minutes to get the variables while Gitlab is starting up in the container