-
Notifications
You must be signed in to change notification settings - Fork 57
test: SDKE 303 evaluate each integration test setup #1110
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
test: SDKE 303 evaluate each integration test setup #1110
Conversation
7a3cc3d to
981133a
Compare
test/src/tests-beaconUpload.ts
Outdated
|
|
||
| // Dispatching event will trigger upload process | ||
| window.dispatchEvent(new Event('pagehide')); | ||
| await Promise.resolve(); |
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 see a few instances of await Promise.resolve() still, are these necessary?
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.
Thanks for pointing that out! I think I missed these in the test-specific PRs. I’ve now removed all occurrences of await Promise.resolve() from both the beaconUpload and batchUploader tests, as there were a few instances which were not needed in that test file as well.
| expect(JSON.parse(window.sessionStorage.getItem(eventStorageKey)).length, 'Events should be populated before dispatch').to.equal(3); | ||
| expect(uploader.batchesQueuedForProcessing.length, 'Batch Queue should be populated before dispatch').to.equal(3); | ||
|
|
||
| window.onbeforeunload = null; |
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 see line 64 currently in master
https://github.com/mParticle/mparticle-web-sdk/blob/master/test/src/tests-beaconUpload.ts#L77
but I don't see line 137 below. what happens if you remove it?
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.
Yesterday i was running each test in isolation to identify which ones were failing, and this test was failing at that time, which is why I added it. However, I don’t think it’s needed, it can be safely removed without affecting the test suite, since setting window.onbeforeunload = null in this test has no impact on the SDK handler.
|
c6faff3
into
test/SDKE-302-evaluate-resetForTests-for-flakey-tests


Background
What Has Changed
Screenshots/Video
Checklist
Additional Notes
Reference Issue (For employees only. Ignore if you are an outside contributor)