diff --git a/.github/workflows/test-and-publish.yml b/.github/workflows/test-and-publish.yml index a80464a..039136b 100644 --- a/.github/workflows/test-and-publish.yml +++ b/.github/workflows/test-and-publish.yml @@ -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: diff --git a/package.json b/package.json index 5df9cce..c1aec0d 100644 --- a/package.json +++ b/package.json @@ -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",