Skip to content

Commit

Permalink
tests: add vitest & basic tests for blog posts (#147)
Browse files Browse the repository at this point in the history
* tests: add `vitest` & basic tests for blog posts

* chore: fix build errors

* chore: format

* build: run test first

* chore: remove rimraf

* chore: remove unused file

* build(npm): add `^` to `vitest/coverage-v8`
  • Loading branch information
sgoudham authored Dec 23, 2024
1 parent cc712ab commit fa1bfcc
Show file tree
Hide file tree
Showing 7 changed files with 607 additions and 46 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# build output
dist/
coverage/

# generated types
.astro/
Expand Down
9 changes: 7 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,18 @@
"type": "module",
"scripts": {
"astro": "astro",
"build": "pnpm run maintainers && astro check && astro build",
"build": "pnpm run maintainers && pnpm run test:run && astro check && astro build",
"check": "astro check",
"dev": "astro dev",
"fmt": "prettier --plugin=prettier-plugin-astro . --write",
"icons": "pnpm tsx src/data/scripts/convertIconsToJson.ts",
"maintainers": "pnpm tsx src/data/scripts/fetchMaintainerAvatars.ts",
"prepare": "husky",
"preview": "astro preview",
"start": "astro dev"
"start": "astro dev",
"test": "vitest",
"test:run": "vitest run",
"test:cov": "vitest run --coverage"
},
"lint-staged": {
"src/**/*": "pnpm run fmt"
Expand All @@ -33,6 +36,7 @@
"@iconify/types": "^2.0.0",
"@rollup/plugin-yaml": "^4.1.2",
"@types/node": "^22.10.1",
"@vitest/coverage-v8": "^2.1.8",
"astro": "^5.0.3",
"astro-expressive-code": "^0.38.3",
"astro-icon": "1.1.2",
Expand All @@ -49,6 +53,7 @@
"svelte": "^5.9.0",
"tsx": "^4.19.2",
"typescript": "^5.7.2",
"vitest": "^2.1.8",
"yaml": "^2.6.1"
},
"packageManager": "[email protected]",
Expand Down
Loading

0 comments on commit fa1bfcc

Please sign in to comment.