Skip to content

Catcher covered with tests#167

Merged
Reversean merged 1 commit intomasterfrom
test/catcher
Mar 5, 2026
Merged

Catcher covered with tests#167
Reversean merged 1 commit intomasterfrom
test/catcher

Conversation

@Reversean
Copy link
Member

@Reversean Reversean commented Feb 25, 2026

Covering with tests components in @hawk.so/javascript:

  • catcher.ts
  • modules/sanitizer.ts
  • utils/validation.ts

Coverage report:

File % Stmts % Branch % Funcs % Lines Uncovered Line #s
All files 67.27 58.64 68.05 66.92
src 94.07 90.19 91.89 94
catcher.ts 94 90.19 91.66 93.91 142-147,158,188,252-255,272,337,662
errors.ts 100 100 100 100
src/addons 56.74 37.31 57.14 56.33
breadcrumbs.ts 47.94 34.88 47.61 47.94 247,279,317-366,375,386-441,451,473-476,480-514,523,531-535,552-556,564-568,575,589-605,641
consoleCatcher.ts 75.36 41.66 71.42 74.62 63,66,88,97-102,132,187,198-211,230,237,285-295
src/integrations 0 0 0 0
vue.ts 0 0 0 0 43-250
src/modules 70.41 62.1 63.04 70.41
fetchTimer.ts 63.63 100 50 63.63 24-25,30-32
sanitizer.ts 98.3 95.12 100 98.3 270
socket.ts 32.65 11.53 18.75 32.65 88-118,142-143,153,157-209
stackParser.ts 76 60.71 77.77 76 50,62,71-72,85-93,134,151-154
src/utils 75 79.03 90.9 74.6
event.ts 88.88 100 100 88.88 44
id.ts 100 100 100 100
log.ts 80 80 100 80 24,39
selector.ts 0 0 0 0 10-43
validation.ts 100 100 100 100
tests 100 100 100 100
catcher.helpers.ts 100 100 100 100

Base automatically changed from chore/core-workspace to master March 3, 2026 16:41
@neSpecc neSpecc requested a review from Copilot March 3, 2026 16:43
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds Vitest coverage support and introduces new unit tests to increase runtime coverage for the JavaScript SDK’s Catcher and validation utilities.

Changes:

  • Added comprehensive tests for Catcher behavior (delivery, dedupe, context/user handling, global handlers, addons).
  • Added focused tests for src/utils/validation.ts helpers.
  • Added a test:coverage script and the @vitest/coverage-v8 dependency to enable coverage reporting.

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 3 comments.

File Description
yarn.lock Locks new coverage-related dependencies (notably @vitest/coverage-v8).
packages/javascript/package.json Adds test:coverage and @vitest/coverage-v8 dev dependency.
packages/javascript/tests/utils/validation.test.ts New tests for validation helpers.
packages/javascript/tests/catcher.test.ts New tests covering Catcher end-to-end behavior using a mocked transport.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Member

@neSpecc neSpecc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should also cover module/sanitizer.ts by tests since it is a critical feature.

@Reversean
Copy link
Member Author

I think we should also cover module/sanitizer.ts by tests since it is a critical feature.

Done.

@Reversean Reversean merged commit a0b7a89 into master Mar 5, 2026
3 checks passed
@Reversean Reversean deleted the test/catcher branch March 5, 2026 08:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants