diff --git a/.github/workflows/ci-test.yml b/.github/workflows/ci-test.yml index 068ea1d..ba4560c 100644 --- a/.github/workflows/ci-test.yml +++ b/.github/workflows/ci-test.yml @@ -28,12 +28,19 @@ jobs: - name: installing dependencies run: npm ci - - name: run tests + - name: run unit tests (on pr) + if: github.event_name == 'pull_request' + run: npm run test:unit -- --reporters=default --reporters=jest-junit + + - name: run all tests + if: github.event_name == 'push' run: npm run test:ci env: WHITELISTED_WALLET_PRIVATE_KEY: ${{ secrets.WHITELISTED_WALLET_PRIVATE_KEY }} SELLER_ENTITY_ID: ${{ secrets.SELLER_ENTITY_ID }} SELLER_AGENT_WALLET_ADDRESS: ${{ secrets.SELLER_AGENT_WALLET_ADDRESS }} + BUYER_ENTITY_ID: ${{ secrets.BUYER_ENTITY_ID }} + BUYER_AGENT_WALLET_ADDRESS: ${{ secrets.BUYER_AGENT_WALLET_ADDRESS }} - name: uploads results uses: actions/upload-artifact@v4 diff --git a/package.json b/package.json index 24349f9..25d849f 100644 --- a/package.json +++ b/package.json @@ -6,6 +6,7 @@ "types": "./dist/index.d.ts", "scripts": { "test": "jest", + "test:unit": "jest test/unit test/component", "test:ci": "jest --ci --reporters=default --reporters=jest-junit", "test:watch": "jest --watch", "test:coverage": "jest --coverage", diff --git a/test/env.ts b/test/env.ts index d46233c..5c1c40a 100644 --- a/test/env.ts +++ b/test/env.ts @@ -1,7 +1,8 @@ import dotenv from "dotenv"; import { Address } from "viem"; +import * as path from "path"; -dotenv.config({ path: __dirname + "/.env" }); +dotenv.config({ path: path.join(__dirname, ".env") }); function getEnvVar(key: string, required = true): T { const value = process.env[key];