-
Notifications
You must be signed in to change notification settings - Fork 142
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
[RUMF-447]: Only collect first-contentful-paint if page is visible #361
Conversation
Codecov Report
@@ Coverage Diff @@
## master #361 +/- ##
==========================================
+ Coverage 86.67% 86.98% +0.31%
==========================================
Files 30 30
Lines 1703 1706 +3
Branches 345 346 +1
==========================================
+ Hits 1476 1484 +8
+ Misses 227 222 -5
Continue to review full report at Codecov.
|
Co-Authored-By: Bastien Caudan <bastien.caudan@gmail.com>
packages/rum/test/rum.spec.ts
Outdated
const session = { | ||
getId: () => undefined, | ||
isTracked: () => true, | ||
isTrackedWithResource: () => true, | ||
} | ||
const FAKE_RESOURCE: Partial<PerformanceEntry> = { name: 'http://foo.com', entryType: 'resource' } | ||
const performanceEntry = { entryType: 'view', name: 'first-contentful-paint' } |
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.
it could be moved to the constant section at the beginning of the describe in order to not repeat it between the two tests
Co-Authored-By: Bastien Caudan <bastien.caudan@gmail.com>
Co-Authored-By: Bastien Caudan <bastien.caudan@gmail.com>
Co-Authored-By: Bastien Caudan <bastien.caudan@gmail.com>
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.
That's great! Now that we are only testing the observed entry types, I think we can move the test into performanceCollection.spec.ts
, and only initialize the performance collection, no need to startRum
etc.
To go even further, we could have something like function getEntryTypesToObserve(): string[]
in performanceCollection.ts
and only test this function instead of the whole performance collection.
No description provided.