Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Test

on:
pull_request:
push:
branches: [main]

permissions:
contents: read

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 24
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
version: 10
run_install: false
- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: "${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}"
restore-keys: |
"${{ runner.os }}-pnpm-store-"
- name: Install dependencies
run: pnpm i --ignore-scripts --frozen-lockfile
- name: Type-check
run: pnpm typecheck
- name: Run tests with coverage
run: pnpm test:coverage
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
# production
/dist

# coverage
/coverage

# GQL
.graphqlconfig
graphql.config.yml
Expand Down
12 changes: 10 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,11 @@
"format": "prettier --write .",
"prebuild": "rimraf dist",
"preinstall": "npx only-allow pnpm",
"build": "pnpm cleanup && tsup **/*.ts --format esm,cjs --dts"
"build": "pnpm cleanup && tsup **/*.ts --format esm,cjs --dts",
"test": "vitest run",
"test:watch": "vitest",
"test:coverage": "vitest run --coverage",
"typecheck": "tsc --noEmit && tsc --noEmit -p tsconfig.test.json"
},
"dependencies": {
"@afosto/graphql-client": "^3.0.0-alpha.7",
Expand All @@ -50,9 +54,13 @@
"jwt-decode": "^4.0.0"
},
"devDependencies": {
"@vitest/coverage-v8": "^4.1.10",
"jsdom": "^29.1.1",
"msw": "^2.15.0",
"prettier": "^3.2.5",
"rimraf": "^5.0.7",
"tsup": "^8.0.2",
"typescript": "^5.4.5"
"typescript": "^5.4.5",
"vitest": "^4.1.10"
}
}
Loading
Loading