From 9a2f1f806166ff5afa65668f420cdb1b117fe808 Mon Sep 17 00:00:00 2001 From: Pavel Birukov Date: Tue, 30 Oct 2018 12:12:41 +0100 Subject: [PATCH] Add test-with-token script, to simplify local testing --- README.md | 7 +++++-- package.json | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) 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" },