Skip to content

Commit

Permalink
Move test output config from Github actions yaml to package.json
Browse files Browse the repository at this point in the history
  • Loading branch information
alexanderbird committed Nov 8, 2020
1 parent 1cea49a commit b4d7449
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/test-and-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,12 @@ jobs:
with:
node-version: 12.x
- run: npm install
- run: JEST_JUNIT_OUTPUT_NAME=junit.unit.xml npm run test:unit
- run: JEST_JUNIT_OUTPUT_NAME=junit.acceptance.local.xml npm run test:acceptance
- run: npm run test:unit
- run: npm run test:acceptance:local
- uses: JS-DevTools/npm-publish@v1
with:
token: ${{ secrets.NPM_TOKEN }}
- name: "Run acceptance tests against published package"
run: JEST_JUNIT_OUTPUT_NAME=junit.acceptance.production.xml SANDBOX_ENVIRONMENT=PRODUCTION npm run test:acceptance
- run: npm run test:acceptance:production
- name: Upload Artifacts
uses: actions/upload-artifact@v2
with:
Expand Down
9 changes: 6 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,12 @@
"test": "test"
},
"scripts": {
"test": "run-s test:*",
"test:unit": "jest --testPathPattern=test/unit",
"test:acceptance": "RESULT_FILE=result.html TEST_SANDBOX=${TEST_SANDBOX:-$(RESULT_FILE=result.html test/acceptance/help/create_sandbox.sh)} jest --testPathPattern=test/acceptance"
"test": "run-s test:unit test:acceptance:local",
"test:unit": "JEST_JUNIT_OUTPUT_NAME=junit.unit.xml jest --testPathPattern=test/unit",
"test:acceptance": "RESULT_FILE=result.html TEST_SANDBOX=${TEST_SANDBOX:-$(RESULT_FILE=result.html test/acceptance/help/create_sandbox.sh)} jest --testPathPattern=test/acceptance",
"test:acceptance:local": "JEST_JUNIT_OUTPUT_NAME=junit.acceptance.local.xml npm run test:acceptance",
"test:acceptance:production": "JEST_JUNIT_OUTPUT_NAME=junit.acceptance.production.xml SANDBOX_ENVIRONMENT=PRODUCTION npm run test:acceptance"

},
"repository": {
"type": "git",
Expand Down

0 comments on commit b4d7449

Please sign in to comment.