From 30ebcb605f5b631611473f9983941cea6dab9305 Mon Sep 17 00:00:00 2001 From: Mariia Lukianets Date: Mon, 24 Jun 2024 17:09:37 +0200 Subject: [PATCH 1/3] add a separate unit test workflow --- .github/workflows/main.yaml | 2 +- .github/workflows/run-tests.yaml | 18 ++++++++++++++++++ package.json | 3 +++ 3 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/run-tests.yaml diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index d26a6c3c..68ac9a7b 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -9,6 +9,6 @@ jobs: - name: Use Node.js 20 uses: actions/setup-node@v4 with: - node-version: 20 + node-version: [20.x] - run: npm ci - run: npm run validate:ci diff --git a/.github/workflows/run-tests.yaml b/.github/workflows/run-tests.yaml new file mode 100644 index 00000000..a073178b --- /dev/null +++ b/.github/workflows/run-tests.yaml @@ -0,0 +1,18 @@ +name: Unit Tests +on: + push: + branches: + - main + pull_request: + types: [opened, synchronize, reopened] +jobs: + run-tests: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Use Node.js 20 + uses: actions/setup-node@v4 + with: + node-version: [20.x] + - run: npm ci + - run: npm run test \ No newline at end of file diff --git a/package.json b/package.json index fe8d637c..effa3d56 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,9 @@ "private": true, "workspaces": ["web-components", "commerce"], "scripts": { + "test": "npm run test:commerce && npm run test:web-components", + "test:commerce": "cd commerce && npm run test:ci", + "test:web-components": "cd web-components && npm run test:ci", "validate:ci": "npm run validate:commerce && npm run validate:web-components", "validate:commerce": "cd commerce && npm run test:ci && npm run build", "validate:web-components": "cd web-components && npm run test:ci && npm run build" From c67f9afd03a06713b435c79fced9a11bf915d07d Mon Sep 17 00:00:00 2001 From: Mariia Lukianets Date: Mon, 24 Jun 2024 17:24:27 +0200 Subject: [PATCH 2/3] fix tests --- commerce/src/defaults.js | 1 + 1 file changed, 1 insertion(+) diff --git a/commerce/src/defaults.js b/commerce/src/defaults.js index 75fb888e..46921d00 100644 --- a/commerce/src/defaults.js +++ b/commerce/src/defaults.js @@ -16,6 +16,7 @@ export const Defaults = Object.freeze({ displayPerUnit: false, displayRecurrence: true, displayTax: false, + domainSwitch: false, env: Env.PRODUCTION, forceTaxExclusive: false, language: 'en', From e81428454f5195adcd83f850e47361b9377b48cf Mon Sep 17 00:00:00 2001 From: Mariia Lukianets Date: Mon, 24 Jun 2024 17:28:54 +0200 Subject: [PATCH 3/3] add missing line --- .github/workflows/run-tests.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/run-tests.yaml b/.github/workflows/run-tests.yaml index a073178b..7188a2c3 100644 --- a/.github/workflows/run-tests.yaml +++ b/.github/workflows/run-tests.yaml @@ -15,4 +15,4 @@ jobs: with: node-version: [20.x] - run: npm ci - - run: npm run test \ No newline at end of file + - run: npm run test