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
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { isIE } from '@datadog/browser-core'
import type { TelemetryEvent } from '../../../../../../packages/core/src/domain/telemetry'
import type { LogsEvent } from '../../../../../../packages/logs/src/logsEvent.types'
import type { RumEvent } from '../../../../../../packages/rum-core/src/rumEvent.types'
Expand All @@ -14,11 +13,6 @@ const LOG_EVENT = {
} as LogsEvent

describe('getIntakeUrlForEvent', () => {
beforeEach(() => {
if (isIE()) {
pending('IE not supported')
}
})
it('should return undefined when RUM is not present', () => {
expect(getIntakeUrlForEvent({} as any, RUM_ERROR_EVENT)).toBeUndefined()
})
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { isIE, isSafari } from '@datadog/browser-core'
import { isSafari } from '@datadog/browser-core'
import { parseQuery, matchWithWildcard } from './eventFilters'

if (!isIE() && !isSafari()) {
if (!isSafari()) {
describe('parseQuery', () => {
it('return a simple field', () => {
expect(parseQuery('foo:bar')).toEqual([['foo', 'bar']])
Expand Down
4 changes: 0 additions & 4 deletions packages/core/src/browser/fetchObservable.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import type { MockFetch, MockFetchManager } from '../../test'
import { registerCleanupTask, mockFetch } from '../../test'
import { isIE } from '../tools/utils/browserDetection'
import type { Subscription } from '../tools/observable'
import type { FetchResolveContext, FetchContext } from './fetchObservable'
import { initFetchObservable } from './fetchObservable'
Expand All @@ -17,9 +16,6 @@ describe('fetch proxy', () => {
let fetch: MockFetch

beforeEach(() => {
if (isIE()) {
pending('no fetch support')
}
mockFetchManager = mockFetch()
originalMockFetch = window.fetch

Expand Down
4 changes: 0 additions & 4 deletions packages/core/src/browser/xhrObservable.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import type { Configuration } from '../domain/configuration'
import { withXhr, mockXhr } from '../../test'
import { isIE } from '../tools/utils/browserDetection'
import type { Subscription } from '../tools/observable'
import type { XhrCompleteContext, XhrContext } from './xhrObservable'
import { initXhrObservable } from './xhrObservable'
Expand Down Expand Up @@ -346,9 +345,6 @@ describe('xhr observable', () => {
})

it('should track request to URL object', (done) => {
if (isIE()) {
pending('IE not supported')
}
withXhr({
setup(xhr) {
xhr.open('GET', new URL('http://example.com/path'))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/* eslint-disable no-console */
import { isIE } from '../../tools/utils/browserDetection'
import { ConsoleApiName } from '../../tools/display'
import type { Subscription } from '../../tools/observable'
import type { ConsoleLog } from './consoleObservable'
Expand Down Expand Up @@ -104,11 +103,7 @@ describe('console error observable', () => {
it('should extract stack from first error', () => {
console.error(new TypeError('foo'), new TypeError('bar'))
const stack = (notifyLog.calls.mostRecent().args[0] as ConsoleLog).stack
if (!isIE()) {
expect(stack).toMatch(/^TypeError: foo\s+at/)
} else {
expect(stack).toContain('TypeError: foo')
}
expect(stack).toContain('TypeError: foo')
})

it('should retrieve fingerprint from error', () => {
Expand Down
4 changes: 0 additions & 4 deletions packages/core/src/domain/error/trackRuntimeError.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { disableJasmineUncaughtExceptionTracking, collectAsyncCalls } from '../../../test'
import { Observable } from '../../tools/observable'
import { isIE } from '../../tools/utils/browserDetection'
import type { UnhandledErrorCallback } from './trackRuntimeError'
import { instrumentOnError, instrumentUnhandledRejection, trackRuntimeError } from './trackRuntimeError'
import type { RawError } from './error.types'
Expand Down Expand Up @@ -49,9 +48,6 @@ describe('trackRuntimeError', () => {
})

it('should collect unhandled rejection', (done) => {
if (isIE()) {
pending('no promise support')
}
disableJasmineUncaughtExceptionTracking()

setTimeout(() => {
Expand Down
4 changes: 0 additions & 4 deletions packages/core/src/domain/session/sessionManager.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import {
import type { Clock } from '../../../test'
import { getCookie, setCookie } from '../../browser/cookie'
import type { RelativeTime } from '../../tools/utils/timeUtils'
import { isIE } from '../../tools/utils/browserDetection'
import { DOM_EVENT } from '../../browser/addEventListener'
import { ONE_HOUR, ONE_SECOND } from '../../tools/utils/timeUtils'
import type { Configuration } from '../configuration'
Expand Down Expand Up @@ -92,9 +91,6 @@ describe('startSessionManager', () => {
}

beforeEach(() => {
if (isIE()) {
pending('no full rum support')
}
clock = mockClock()

registerCleanupTask(() => {
Expand Down
4 changes: 0 additions & 4 deletions packages/core/src/tools/readBytesFromStream.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { isIE } from './utils/browserDetection'
import { readBytesFromStream } from './readBytesFromStream'

describe('readBytesFromStream', () => {
Expand All @@ -7,9 +6,6 @@ describe('readBytesFromStream', () => {
let stream: ReadableStream

beforeEach(() => {
if (isIE()) {
pending('no ReadableStream support')
}
beenCalled = false
stream = new ReadableStream({
pull: (controller) => {
Expand Down
26 changes: 3 additions & 23 deletions packages/core/src/tools/serialisation/sanitize.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { isIE } from '../utils/browserDetection'
import { display } from '../display'
import { createNewEvent } from '../../../test'
import { sanitize } from './sanitize'
Expand Down Expand Up @@ -30,12 +29,7 @@ describe('sanitize', () => {
function testFunction() {
return true
}
if (isIE()) {
// IE does not provide access to function name
expect(sanitize(testFunction)).toBe('[Function] unknown')
} else {
expect(sanitize(testFunction)).toBe('[Function] testFunction')
}
expect(sanitize(testFunction)).toBe('[Function] testFunction')
})

it('should handle bigint', () => {
Expand Down Expand Up @@ -102,19 +96,10 @@ describe('sanitize', () => {
['a', 13],
['b', 37],
])
if (isIE()) {
// IE does not distinguish maps, weakmaps, sets... from generic objects
expect(sanitize(map)).toEqual({})
} else {
expect(sanitize(map)).toBe('[Map]')
}
expect(sanitize(map)).toBe('[Map]')
})

it('should survive when toStringTag throws', () => {
if (isIE()) {
pending('IE does not support Symbols')
}

class CannotSerialize {
get [Symbol.toStringTag]() {
throw Error('Cannot serialize')
Expand Down Expand Up @@ -229,12 +214,7 @@ describe('sanitize', () => {
const obj = { b: 42, toJSON: faulty }

// Since toJSON throws, sanitize falls back to serialize property by property
if (isIE()) {
// IE does not provide access to function name
expect(sanitize(obj)).toEqual({ b: 42, toJSON: '[Function] unknown' })
} else {
expect(sanitize(obj)).toEqual({ b: 42, toJSON: '[Function] faulty' })
}
expect(sanitize(obj)).toEqual({ b: 42, toJSON: '[Function] faulty' })
})
})

Expand Down
7 changes: 0 additions & 7 deletions packages/core/test/leakDetection.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { display } from '../src/tools/display'
import { isIE } from '../src/tools/utils/browserDetection'
import { getCurrentJasmineSpec } from './getCurrentJasmineSpec'

let originalAddEventListener: typeof EventTarget.prototype.addEventListener
Expand All @@ -9,9 +8,6 @@ let wrappedListeners: {
}

export function startLeakDetection() {
if (isIE()) {
return
}
wrappedListeners = {}

// eslint-disable-next-line @typescript-eslint/unbound-method
Expand All @@ -35,9 +31,6 @@ export function startLeakDetection() {
}

export function stopLeakDetection() {
if (isIE()) {
return
}
EventTarget.prototype.addEventListener = originalAddEventListener
EventTarget.prototype.removeEventListener = originalRemoveEventListener
wrappedListeners = {}
Expand Down
28 changes: 14 additions & 14 deletions packages/logs/BROWSER_SUPPORT.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# Browser Support

| Feature | Chrome | Firefox | Safari | Edge | Chrome Android | Safari iOS | IE11 | < IE11 | Opera |
| -------------- | ------ | ------- | ------ | ---- | -------------- | ---------- | ---- | ------ | ----- |
| loading | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ | ✅ |
| init | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ | ✅ |
| global context | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ | ✅ |
| logs request | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ | ✅ |
| flush on hide | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ | ❌ | ✅ |
| console error | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ | ✅ |
| network error | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ | ✅ |
| runtime error | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ | ✅ |
| CSP violation | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ | ❌ | ✅ |
| reports | ✅ | ❌ | ❌ | ✅ | ✅ | ❌ | ❌ | ❌ | ✅ |
| custom logger | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ | ✅ |
| handler | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ | ✅ |
| Feature | Chrome | Firefox | Safari | Edge | Chrome Android | Safari iOS | IE | Opera |
| -------------- | ------ | ------- | ------ | ---- | -------------- | ---------- | --- | ----- |
| loading | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | | ✅ |
| init | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | | ✅ |
| global context | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | | ✅ |
| logs request | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | | ✅ |
| flush on hide | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ | ✅ |
| console error | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | | ✅ |
| network error | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | | ✅ |
| runtime error | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | | ✅ |
| CSP violation | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ | ✅ |
| reports | ✅ | ❌ | ❌ | ✅ | ✅ | ❌ | ❌ | ✅ |
| custom logger | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | | ✅ |
| handler | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | | ✅ |
7 changes: 0 additions & 7 deletions packages/logs/src/boot/preStartLogs.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import {
TrackingConsent,
createTrackingConsentState,
display,
isIE,
resetFetchObservable,
} from '@datadog/browser-core'
import type { CommonContext } from '../rawLogsEvent.types'
Expand Down Expand Up @@ -217,12 +216,6 @@ describe('preStartLogs', () => {
})

describe('basic methods instrumentation', () => {
beforeEach(() => {
if (isIE()) {
pending('No support for IE')
}
})

it('should instrument fetch even if tracking consent is not granted', () => {
const originalFetch = window.fetch

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { isIE, ErrorSource } from '@datadog/browser-core'
import { ErrorSource } from '@datadog/browser-core'
import type { MockFetch, MockFetchManager } from '@datadog/browser-core/test'
import { SPEC_ENDPOINTS, MockResponse, mockFetch, registerCleanupTask } from '@datadog/browser-core/test'
import type { RawNetworkLogsEvent } from '../../rawLogsEvent.types'
Expand Down Expand Up @@ -45,9 +45,6 @@ describe('network error collection', () => {
}

beforeEach(() => {
if (isIE()) {
pending('no fetch support')
}
rawLogsEvents = []
lifeCycle = new LifeCycle()
lifeCycle.subscribe(LifeCycleEventType.RAW_LOG_COLLECTED, (rawLogsEvent) =>
Expand Down Expand Up @@ -189,10 +186,6 @@ describe('computeFetchResponseText', () => {
let onunhandledrejectionSpy: jasmine.Spy

beforeEach(() => {
if (isIE()) {
pending('IE does not support the fetch API')
}

onunhandledrejectionSpy = jasmine.createSpy()
window.onunhandledrejection = onunhandledrejectionSpy

Expand Down
7 changes: 0 additions & 7 deletions packages/rum-core/src/boot/preStartRum.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import {
ExperimentalFeature,
resetExperimentalFeatures,
resetFetchObservable,
isIE,
} from '@datadog/browser-core'
import type { Clock } from '@datadog/browser-core/test'
import {
Expand Down Expand Up @@ -712,12 +711,6 @@ describe('preStartRum', () => {
})

describe('basic methods instrumentation', () => {
beforeEach(() => {
if (isIE()) {
pending('No support for IE')
}
})

it('should instrument fetch even if tracking consent is not granted', () => {
const originalFetch = window.fetch

Expand Down
8 changes: 0 additions & 8 deletions packages/rum-core/src/boot/startRum.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import {
ONE_SECOND,
findLast,
noop,
isIE,
relativeNow,
createIdentityEncoder,
createCustomerDataTracker,
Expand Down Expand Up @@ -88,10 +87,6 @@ describe('rum session', () => {
let serverRumEvents: RumEvent[]

beforeEach(() => {
if (isIE()) {
pending('no full rum support')
}

setupBuilder = setup().beforeBuild(
({
location,
Expand Down Expand Up @@ -146,9 +141,6 @@ describe('rum session keep alive', () => {
let serverRumEvents: RumEvent[]

beforeEach(() => {
if (isIE()) {
pending('no full rum support')
}
sessionManager = createRumSessionManagerMock().setId('1234')
setupBuilder = setup()
.withFakeClock()
Expand Down
11 changes: 0 additions & 11 deletions packages/rum-core/src/browser/domMutationObservable.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { isIE } from '@datadog/browser-core'
import type { MockZoneJs } from '@datadog/browser-core/test'
import { registerCleanupTask, mockZoneJs } from '@datadog/browser-core/test'
import { createDOMMutationObservable, getMutationObserverConstructor } from './domMutationObservable'
Expand All @@ -8,12 +7,6 @@ import { createDOMMutationObservable, getMutationObserverConstructor } from './d
const DOM_MUTATION_OBSERVABLE_DURATION = 16

describe('domMutationObservable', () => {
beforeEach(() => {
if (isIE()) {
pending('dom mutation not available')
}
})

function domMutationSpec(mutate: (root: HTMLElement) => void, { expectedMutations }: { expectedMutations: number }) {
return (done: DoneFn) => {
const root = document.createElement('div')
Expand Down Expand Up @@ -113,10 +106,6 @@ describe('domMutationObservable', () => {
const OriginalMutationObserverConstructor = window.MutationObserver

beforeEach(() => {
if (isIE()) {
pending('dom mutation not available')
}

zoneJs = mockZoneJs()

registerCleanupTask(() => {
Expand Down
Loading