Skip to content

Commit

Permalink
feat: add coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
SharzyL committed Apr 12, 2024
1 parent 660ae4d commit 3e2fb4a
Show file tree
Hide file tree
Showing 4 changed files with 566 additions and 151 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ node_modules/

.idea
.wrangler
coverage
9 changes: 6 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,18 @@
"deploy": "wrangler deploy",
"dev": "wrangler dev --var BASE_URL:http://localhost:8787 --port 8787",
"build": "wrangler deploy --dry-run --outdir=dist",
"test": "vitest"
"delete-paste": "wrangler kv:key delete --binding PB",
"test": "vitest",
"coverage": "vitest run --coverage"
},
"author": "SharzyL <[email protected]>",
"license": "MIT",
"devDependencies": {
"@cloudflare/vitest-pool-workers": "^0.1.18",
"@cloudflare/vitest-pool-workers": "https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/8561120366/npm-package-cloudflare-vitest-pool-workers-5458",
"@vitest/coverage-istanbul": "1.4.0",
"vitest": "1.4.0",
"eslint": "^8.33.0",
"prettier": "^2.8.3",
"vitest": "1.3.0",
"wrangler": "^3.32.0"
},
"dependencies": {
Expand Down
8 changes: 6 additions & 2 deletions vite.config.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
import { defineWorkersConfig } from "@cloudflare/vitest-pool-workers/config"

const cfg = defineWorkersConfig({
assetsInclude: [ "frontend/*", "doc/*", "test/resources/*" ],
assetsInclude: ["frontend/*", "doc/*", "test/resources/*"],

test: {
coverage: {
provider: "istanbul", // v8 is not supported due for cf workers
reporter: ["text", "json", "html"],
},
poolOptions: {
workers: {
wrangler: {
configPath: "./wrangler.toml"
configPath: "./wrangler.toml",
},
},
},
Expand Down
Loading

0 comments on commit 3e2fb4a

Please sign in to comment.