Skip to content

Commit

Permalink
chore: improve test coverage reporting (#1624)
Browse files Browse the repository at this point in the history
### Overview

Tweak the code coverage report, and upgrade to the latest `vitest`.
  • Loading branch information
oliverlaz authored Dec 13, 2024
1 parent 80e8c84 commit 32bb870
Show file tree
Hide file tree
Showing 3 changed files with 83 additions and 72 deletions.
6 changes: 3 additions & 3 deletions packages/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"start": "rollup -w -c",
"build": "yarn clean && rollup -c",
"test": "vitest",
"test-ci": "vitest --coverage",
"test-ci": "vitest run --coverage",
"generate:open-api": "./generate-openapi.sh protocol",
"generate:open-api:dev": "./generate-openapi.sh chat",
"generate:timer-worker": "./generate-timer-worker.sh"
Expand Down Expand Up @@ -45,15 +45,15 @@
"@stream-io/node-sdk": "^0.4.3",
"@types/sdp-transform": "^2.4.7",
"@types/ua-parser-js": "^0.7.37",
"@vitest/coverage-v8": "^2.1.4",
"@vitest/coverage-v8": "^2.1.8",
"dotenv": "^16.3.1",
"happy-dom": "^11.0.2",
"prettier": "^3.3.2",
"rimraf": "^5.0.7",
"rollup": "^4.22.0",
"typescript": "^5.5.2",
"vite": "^5.4.6",
"vitest": "^2.1.4",
"vitest": "^2.1.8",
"vitest-mock-extended": "^2.0.2"
}
}
7 changes: 5 additions & 2 deletions packages/client/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
import { defineConfig } from 'vitest/config';

export default defineConfig({
// TODO: move build process to Vite
build: {},
test: {
coverage: {
ignoreEmptyLines: true,
provider: 'v8',
include: ['src/**'],
exclude: ['**/__tests__/**', 'src/gen/**'],
reportsDirectory: './coverage',
reporter: ['lcov'],
},
},
Expand Down
142 changes: 75 additions & 67 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8552,7 +8552,7 @@ __metadata:
"@stream-io/node-sdk": ^0.4.3
"@types/sdp-transform": ^2.4.7
"@types/ua-parser-js": ^0.7.37
"@vitest/coverage-v8": ^2.1.4
"@vitest/coverage-v8": ^2.1.8
axios: ^1.7.7
dotenv: ^16.3.1
happy-dom: ^11.0.2
Expand All @@ -8564,7 +8564,7 @@ __metadata:
typescript: ^5.5.2
ua-parser-js: ^1.0.36
vite: ^5.4.6
vitest: ^2.1.4
vitest: ^2.1.8
vitest-mock-extended: ^2.0.2
webrtc-adapter: ^8.2.3
languageName: unknown
Expand Down Expand Up @@ -10301,9 +10301,9 @@ __metadata:
languageName: node
linkType: hard

"@vitest/coverage-v8@npm:^2.1.4":
version: 2.1.4
resolution: "@vitest/coverage-v8@npm:2.1.4"
"@vitest/coverage-v8@npm:^2.1.8":
version: 2.1.8
resolution: "@vitest/coverage-v8@npm:2.1.8"
dependencies:
"@ampproject/remapping": ^2.3.0
"@bcoe/v8-coverage": ^0.2.3
Expand All @@ -10314,36 +10314,36 @@ __metadata:
istanbul-reports: ^3.1.7
magic-string: ^0.30.12
magicast: ^0.3.5
std-env: ^3.7.0
std-env: ^3.8.0
test-exclude: ^7.0.1
tinyrainbow: ^1.2.0
peerDependencies:
"@vitest/browser": 2.1.4
vitest: 2.1.4
"@vitest/browser": 2.1.8
vitest: 2.1.8
peerDependenciesMeta:
"@vitest/browser":
optional: true
checksum: 29ad6800afd93fa36d86b0df45d1a108395501743f9248c6a46baa35ea4d74cafbd6f0a29d897460c81eb4f4bbe96bfd915458d0160b5a45b9cab5c565db9f2f
checksum: 7453a33bddd051f70d9424e4b26db434ac792962af7a063952617ff8b0880733ccdc5afb7b8668c3af0b18edb1102725ebb4377d6d00bc6ac0202927e68166e3
languageName: node
linkType: hard

"@vitest/expect@npm:2.1.4":
version: 2.1.4
resolution: "@vitest/expect@npm:2.1.4"
"@vitest/expect@npm:2.1.8":
version: 2.1.8
resolution: "@vitest/expect@npm:2.1.8"
dependencies:
"@vitest/spy": 2.1.4
"@vitest/utils": 2.1.4
"@vitest/spy": 2.1.8
"@vitest/utils": 2.1.8
chai: ^5.1.2
tinyrainbow: ^1.2.0
checksum: 613d527e74c2dd6f6ecd75cdf8c67a2abfaca0e9795883ff3cba529c6ce462e149a9ee359bab4b49cbb68b4e31a51cf489281d3e2f24820a47438ec774f7672a
checksum: 3e81e61dfb5222797ab5e6a70bee2d032fb382c9e7ddc4abe03114f0efbc4cc3b56fc2648e89ae26f5d9261554ea7c696b3a329c8ccea2c702cb87476e4a6842
languageName: node
linkType: hard

"@vitest/mocker@npm:2.1.4":
version: 2.1.4
resolution: "@vitest/mocker@npm:2.1.4"
"@vitest/mocker@npm:2.1.8":
version: 2.1.8
resolution: "@vitest/mocker@npm:2.1.8"
dependencies:
"@vitest/spy": 2.1.4
"@vitest/spy": 2.1.8
estree-walker: ^3.0.3
magic-string: ^0.30.12
peerDependencies:
Expand All @@ -10354,57 +10354,57 @@ __metadata:
optional: true
vite:
optional: true
checksum: ba5b6e1084b69aaa0e5b93be5f3a1c37c3f1ba4b2c977f38aaa048ec337e03694cd8de002bb5199e69259206cc03cbc0b911e4e167c95d84b88aaa0b6a40b5a7
checksum: 0022d76ff78043c0788380b4e530a03690f8a89a14d1d07c4c069c8fd828a4741d2777ebc486ca0f89b2fb8cf880a7880d6891dd7cfb8cf4339f040131a8bda2
languageName: node
linkType: hard

"@vitest/pretty-format@npm:2.1.4, @vitest/pretty-format@npm:^2.1.4":
version: 2.1.4
resolution: "@vitest/pretty-format@npm:2.1.4"
"@vitest/pretty-format@npm:2.1.8, @vitest/pretty-format@npm:^2.1.8":
version: 2.1.8
resolution: "@vitest/pretty-format@npm:2.1.8"
dependencies:
tinyrainbow: ^1.2.0
checksum: 4d6c799d9b9418ebfce77df518a5ea8717051bdb5eecce63d6b7009634d4843630c0bc424d0f405bd12b8f404e4bf09b6f208a331568de9b6b9395322221e41c
checksum: 2214ca317a19220a5f308a4e77fe403fa091c2f006d1f5b1bd91e8fad6e167db2fdc7882e564da3518d5b2cd9dedb1e97067bb666a820519c54f1c26ac9b0c5a
languageName: node
linkType: hard

"@vitest/runner@npm:2.1.4":
version: 2.1.4
resolution: "@vitest/runner@npm:2.1.4"
"@vitest/runner@npm:2.1.8":
version: 2.1.8
resolution: "@vitest/runner@npm:2.1.8"
dependencies:
"@vitest/utils": 2.1.4
"@vitest/utils": 2.1.8
pathe: ^1.1.2
checksum: f0584dc51ae2ebe6a768e9d832ff3821e107c0fed3b20a83879be83cb452a662ffa1d57abf06276915f13d0590874cade6f7a184d401285e1fe1cc1fb77b5f32
checksum: 50625597a01fbb55e7edf303b2ce6df7a46347bf05017ce7c4b4ce491ac6d85380aa5dd80127307f2621dc4b3b4081ef8ba1f3f825335f0af812a8e4e08d4aa2
languageName: node
linkType: hard

"@vitest/snapshot@npm:2.1.4":
version: 2.1.4
resolution: "@vitest/snapshot@npm:2.1.4"
"@vitest/snapshot@npm:2.1.8":
version: 2.1.8
resolution: "@vitest/snapshot@npm:2.1.8"
dependencies:
"@vitest/pretty-format": 2.1.4
"@vitest/pretty-format": 2.1.8
magic-string: ^0.30.12
pathe: ^1.1.2
checksum: c45055e483e7276197e6e67aa6f310f75cad4639ae5732308319eab19ce2c2772b326563a12b59fca0bb68a19a48d6a8eeda0bab81de9048fa927f8964635c04
checksum: ff6a6033fe891c9b19fc33ef2518c29e8afca17c02c463b6b1f40e7e7d51867d5c0bb9b49f524b7c0889337a2c0cae7dcc864851a59a28d3a6e0488cecc45040
languageName: node
linkType: hard

"@vitest/spy@npm:2.1.4":
version: 2.1.4
resolution: "@vitest/spy@npm:2.1.4"
"@vitest/spy@npm:2.1.8":
version: 2.1.8
resolution: "@vitest/spy@npm:2.1.8"
dependencies:
tinyspy: ^3.0.2
checksum: c91874b7e4f42cbdd4bd71a5afb9a4f25da72bf076f7e011d9f600749ef50d8baf7cbf32b0f3d7a418e0923ba402e2f8835041f950d449fe40faef335c6a07f8
checksum: 0e497e7a7f3170f761c0dbdf983f13d09616b2bae7f640c216644f8d3d1f1a6b6e59aa1e6b75ca2a773355811f0ad6b9d7b6b14596d9b99378040917cada5d49
languageName: node
linkType: hard

"@vitest/utils@npm:2.1.4":
version: 2.1.4
resolution: "@vitest/utils@npm:2.1.4"
"@vitest/utils@npm:2.1.8":
version: 2.1.8
resolution: "@vitest/utils@npm:2.1.8"
dependencies:
"@vitest/pretty-format": 2.1.4
"@vitest/pretty-format": 2.1.8
loupe: ^3.1.2
tinyrainbow: ^1.2.0
checksum: f7d9a4e8c411b9e80e7df46a725933977c9a330b133cc17e39e6f069d31832a849c070ef18b96abe2f07847f1860f36c8dd081eff2dad62b2874592d68e7dc43
checksum: 711e7998ba9785880ed416d08b478e2b881cd218d37c3d773b26477adaa6aab91758e01ac039f839175f446111118fb5aa041317b619eeeb05537e3912159eb7
languageName: node
linkType: hard

Expand Down Expand Up @@ -13965,6 +13965,13 @@ __metadata:
languageName: node
linkType: hard

"es-module-lexer@npm:^1.5.4":
version: 1.5.4
resolution: "es-module-lexer@npm:1.5.4"
checksum: a0cf04fb92d052647ac7d818d1913b98d3d3d0f5b9d88f0eafb993436e4c3e2c958599db68839d57f2dfa281fdf0f60e18d448eb78fc292c33c0f25635b6854f
languageName: node
linkType: hard

"es-object-atoms@npm:^1.0.0":
version: 1.0.0
resolution: "es-object-atoms@npm:1.0.0"
Expand Down Expand Up @@ -25722,10 +25729,10 @@ __metadata:
languageName: node
linkType: hard

"std-env@npm:^3.7.0":
version: 3.7.0
resolution: "std-env@npm:3.7.0"
checksum: 4f489d13ff2ab838c9acd4ed6b786b51aa52ecacdfeaefe9275fcb220ff2ac80c6e95674723508fd29850a694569563a8caaaea738eb82ca16429b3a0b50e510
"std-env@npm:^3.8.0":
version: 3.8.0
resolution: "std-env@npm:3.8.0"
checksum: ad4554485c2d09138a1d0f03944245e169510e6f5200b7d30fcdd4536e27a2a9a2fd934caff7ef58ebbe21993fa0e2b9e5b1979f431743c925305863b7ff36d5
languageName: node
linkType: hard

Expand Down Expand Up @@ -27885,17 +27892,18 @@ __metadata:
languageName: node
linkType: hard

"vite-node@npm:2.1.4":
version: 2.1.4
resolution: "vite-node@npm:2.1.4"
"vite-node@npm:2.1.8":
version: 2.1.8
resolution: "vite-node@npm:2.1.8"
dependencies:
cac: ^6.7.14
debug: ^4.3.7
es-module-lexer: ^1.5.4
pathe: ^1.1.2
vite: ^5.0.0
bin:
vite-node: vite-node.mjs
checksum: 2ab745aa9f1154e6dde4c47647b2785968828f9d5c46ae06facea35a276c89ab550346c4ec3116d1d095b5cb96aeef668ed8fbd4d26477c6dd15fa598bbc1098
checksum: 17914342d05f9ace35c1574555c59dd4116148b71a22bf330f019681d7238a2244b6c2b4a8930d03d5f78e24666d81806c68b84a8db42d7e84165cb10d1c756a
languageName: node
linkType: hard

Expand Down Expand Up @@ -27954,35 +27962,35 @@ __metadata:
languageName: node
linkType: hard

"vitest@npm:^2.1.4":
version: 2.1.4
resolution: "vitest@npm:2.1.4"
dependencies:
"@vitest/expect": 2.1.4
"@vitest/mocker": 2.1.4
"@vitest/pretty-format": ^2.1.4
"@vitest/runner": 2.1.4
"@vitest/snapshot": 2.1.4
"@vitest/spy": 2.1.4
"@vitest/utils": 2.1.4
"vitest@npm:^2.1.8":
version: 2.1.8
resolution: "vitest@npm:2.1.8"
dependencies:
"@vitest/expect": 2.1.8
"@vitest/mocker": 2.1.8
"@vitest/pretty-format": ^2.1.8
"@vitest/runner": 2.1.8
"@vitest/snapshot": 2.1.8
"@vitest/spy": 2.1.8
"@vitest/utils": 2.1.8
chai: ^5.1.2
debug: ^4.3.7
expect-type: ^1.1.0
magic-string: ^0.30.12
pathe: ^1.1.2
std-env: ^3.7.0
std-env: ^3.8.0
tinybench: ^2.9.0
tinyexec: ^0.3.1
tinypool: ^1.0.1
tinyrainbow: ^1.2.0
vite: ^5.0.0
vite-node: 2.1.4
vite-node: 2.1.8
why-is-node-running: ^2.3.0
peerDependencies:
"@edge-runtime/vm": "*"
"@types/node": ^18.0.0 || >=20.0.0
"@vitest/browser": 2.1.4
"@vitest/ui": 2.1.4
"@vitest/browser": 2.1.8
"@vitest/ui": 2.1.8
happy-dom: "*"
jsdom: "*"
peerDependenciesMeta:
Expand All @@ -28000,7 +28008,7 @@ __metadata:
optional: true
bin:
vitest: vitest.mjs
checksum: 6b38640d0d5340d80da82d0fcc075d340a30b4c89066057e873da1207f9d5856e7e8f3282cca4ad27861b73df2465aad58643e078c1cc5e36de3968547f45bd7
checksum: 2d2f69364556829123c3ff704b36dfd7a2f11cc05fad8a7caf9f0b8c74205caee92f892d4bd5b92a9c2a48267e9b0865a171b2f40fcd593d681f980c3486b299
languageName: node
linkType: hard

Expand Down

0 comments on commit 32bb870

Please sign in to comment.