diff --git a/README.md b/README.md index bc1c6b3d..8eb992ca 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/package.json b/package.json index e4afba48..77b92262 100644 --- a/package.json +++ b/package.json @@ -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" },