Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: setup vitest #64

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
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
5 changes: 5 additions & 0 deletions .changeset/gorgeous-keys-eat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@scio-labs/use-inkathon": minor
---

chore: setup project to be testable
43 changes: 43 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
name: Testsuite

on:
pull_request:
branches:
- main

jobs:
release:
name: Unit Test
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20]
pnpm-version: [8.11]
steps:
- name: Checkout Repo
uses: actions/checkout@v3
with:
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
fetch-depth: 0
submodules: true

- name: Set up pnpm action ${{ matrix.pnpm-version }}
uses: pnpm/action-setup@v2
with:
version: ${{ matrix.pnpm-version }}

- name: Set up Node ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
cache: 'pnpm'
node-version: ${{ matrix.node-version }}

- name: Install Dependencies
run: pnpm install --frozen-lockfile

- name: Run Unit Tests
run: pnpm test:ci

- name: Run Coverage Analysis
run: pnpm coverage
10 changes: 9 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@
},
"scripts": {
"build": "tsup",
"test": "vitest",
"test:ci": "vitest run",
"coverage": "vitest run --coverage",
"dev": "tsup --watch",
"dev:react-example": "concurrently \"pnpm run dev\" \"pnpm run -F \"{examples/react-ts}\" dev\"",
"dev:scripts-example": "pnpm run build && pnpm run -F \"{examples/scripts-ts}\" script",
Expand Down Expand Up @@ -93,19 +96,24 @@
"devDependencies": {
"@changesets/changelog-github": "^0.5.0",
"@changesets/cli": "^2.27.1",
"@testing-library/react": "^14.2.1",
"@types/node": "^20.11.16",
"@types/react": "^18.2.53",
"@typescript-eslint/eslint-plugin": "^6.20.0",
"@typescript-eslint/parser": "^6.20.0",
"@vitest/coverage-v8": "latest",
"concurrently": "^8.2.2",
"eslint": "^8.56.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-react": "^7.33.2",
"happy-dom": "^13.3.8",
"lint-staged": "^15.2.1",
"prettier": "^3.2.5",
"simple-git-hooks": "^2.9.0",
"tsup": "^8.0.1",
"typedoc": "^0.25.7",
"typescript": "^5.3.3"
"typescript": "^5.3.3",
"vite-tsconfig-paths": "^4.3.1",
"vitest": "latest"
}
}
Loading
Loading