-
Notifications
You must be signed in to change notification settings - Fork 39
chore: add telemetry unit tests #109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Pull Request Test Coverage Report for Build 14672206053Details
💛 - Coveralls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds unit tests for telemetry functionalities to ensure correct event emission behaviors under various conditions.
- Introduces tests for sending events and caching on failures when telemetry is enabled.
- Adds tests to verify no events are sent when telemetry is disabled or DO_NOT_TRACK is enabled.
- Verifies that common telemetry properties are correctly attached to events.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice; just a question I'm wondering about
|
||
beforeEach(() => { | ||
// Reset mocks before each test | ||
jest.clearAllMocks(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not too familiar with jest but since the original file mock happens in the global scope and doesn't get re-run; doesn't that imply this should clear that as well?
I assume this works I'm just trying to understand if jest doesn't clear file mocks here or something
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep thanks for the question, the global scope ones guarantee that we won't use the actual implementation while the clear will simply clean up any leftover state between runs
No description provided.