Skip to content

Commit

Permalink
Add vitest and stryker
Browse files Browse the repository at this point in the history
  • Loading branch information
alephtwo committed Nov 5, 2024
1 parent d8f2df4 commit a819e1d
Show file tree
Hide file tree
Showing 13 changed files with 1,547 additions and 12 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ concurrency:
jobs:
lint:
uses: "./.github/workflows/lint.yaml"
test:
uses: "./.github/workflows/test.yaml"
deploy:
needs: "lint"
environment:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
- name: "Install Dependencies"
run: "pnpm install --frozen-lockfile"
- name: "Run markdownlint"
run: "pnpm mdl"
run: "pnpm lint:md"
yaml:
name: "Lint YAML"
runs-on: "ubuntu-latest"
Expand Down
24 changes: 24 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
name: "Test"
on:
push:
branches-ignore:
- "main"
workflow_call:
jobs:
test:
name: "Run unit tests"
runs-on: "ubuntu-latest"
steps:
- uses: "actions/checkout@v4"
- uses: "pnpm/action-setup/@v4"
with:
version: "latest"
- uses: "actions/setup-node@v4"
with:
node-version: "lts/iron"
cache: "pnpm"
- name: "Install Dependencies"
run: "pnpm install --frozen-lockfile"
- name: "Run unit tests"
run: "pnpm test"
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
/node_modules
/dist
/coverage
/reports
3 changes: 3 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
public-hoist-pattern[]=@stryker-mutator/api
public-hoist-pattern[]=*eslint*
public-hoist-pattern[]=*prettier*
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
/dist
/pnpm-lock.yaml
/coverage
/reports
2 changes: 2 additions & 0 deletions .yamllint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ ignore:
- "/node_modules"
- "/dist"
- "pnpm-lock.yaml"
- "/coverage"
- "/reports"
rules:
truthy:
check-keys: false
Expand Down
2 changes: 1 addition & 1 deletion eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import tseslint from "typescript-eslint";
export default tseslint.config(
eslint.configs.recommended,
{
ignores: ["dist/**"],
ignores: ["dist/**", "coverage/**", "reports/**"],
},
{
files: ["**/*.ts", "**/*.tsx"],
Expand Down
14 changes: 10 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,16 @@
"main": "index.js",
"scripts": {
"start": "vite",
"test": "vitest run",
"coverage": "pnpm test -- --coverage",
"mutate": "stryker run",
"preview": "vite preview",
"build": "tsc && vite build",
"prettier": "prettier --check .",
"format": "prettier --write .",
"lint": "pnpm lint:ts && pnpm prettier && pnpm lint:md",
"lint:ts": "eslint .",
"prettier": "prettier --check .",
"mdl": "markdownlint .",
"lint": "npm run lint:ts && npm run prettier"
"lint:md": "markdownlint ."
},
"repository": {
"type": "git",
Expand All @@ -25,6 +28,8 @@
"homepage": "https://github.com/alephtwo/sparky#readme",
"devDependencies": {
"@mui/system": "6.1.6",
"@stryker-mutator/core": "8.6.0",
"@stryker-mutator/vitest-runner": "8.6.0",
"@types/react": "18.3.12",
"@types/react-dom": "18.3.1",
"@vitejs/plugin-react-swc": "3.7.1",
Expand All @@ -34,7 +39,8 @@
"prettier": "3.3.3",
"typescript": "5.6.3",
"typescript-eslint": "8.13.0",
"vite": "5.4.10"
"vite": "5.4.10",
"vitest": "2.1.4"
},
"dependencies": {
"@emotion/react": "11.13.3",
Expand Down
Loading

0 comments on commit a819e1d

Please sign in to comment.