Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/rum-core/test/common/xhr-patch.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ describe('xhrPatch', function () {
const req = new window.XMLHttpRequest()
const getEvents = registerEventListener(req)
req.open('GET', 'https://elastic.co/guide', true)
req.timeout = 1
req.addEventListener('loadend', () => {
expect(getEvents(done).map(e => e.event)).toEqual(['schedule', 'invoke'])
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,13 @@ describe('PerformanceMonitoring', function () {

it('should notify when a transaction has been filtered out', function () {
spyOn(configService, 'dispatchEvent')
var tr = new Transaction('transaction-no-duration', 'transaction-type')
tr.end()
// NOTE: tests in SauceLabs fail because the duration becomes 1. Setting the start & end
// times will ensure `duration` is 0.
var now = Date.now()
var tr = new Transaction('transaction-no-duration', 'transaction-type', {
startTime: now
})
tr.end(now)

var payload = performanceMonitoring.createTransactionPayload(tr)
expect(payload).toBeUndefined()
Expand Down
Loading