Add test-with-token script, to simplify local testing

This commit is contained in:
Pavel Birukov 2018-10-30 12:12:41 +01:00
parent f2da029b15
commit 9a2f1f8061
2 changed files with 6 additions and 2 deletions

View File

@ -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

View File

@ -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"
},