mirror of
https://github.com/jdalrymple/gitbeaker.git
synced 2026-01-18 15:55:30 +00:00
Add test-with-token script, to simplify local testing
This commit is contained in:
parent
f2da029b15
commit
9a2f1f8061
@ -450,14 +450,17 @@ docker-compose -f docker-compose.test.yml up
|
||||
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}"')
|
||||
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
|
||||
npm run test
|
||||
|
||||
# or, alternatively
|
||||
npm run test-with-token # sets PERSONAL_ACCESS_TOKEN and GITLAB_URL from above, before running tests
|
||||
```
|
||||
|
||||
You can also define them in front of the npm script
|
||||
|
||||
@ -18,6 +18,7 @@
|
||||
"test:infrastructure": "jest test/tests/infrastructure",
|
||||
"test:services": "jest test/tests/services",
|
||||
"test": "jest --debug --runInBand && codecov",
|
||||
"test-with-token": "PERSONAL_ACCESS_TOKEN=$(docker exec -it gitlab bash -lc 'printf \"%q\" \"${PERSONAL_ACCESS_TOKEN}\"') GITLAB_URL=$(docker exec -it gitlab bash -lc 'printf \"%q\" \"${GITLAB_URL}\"') npm run test",
|
||||
"prepublishOnly": "npm run build",
|
||||
"semantic-release": "semantic-release"
|
||||
},
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user