Skip to content

Commit

Permalink
Uncomment tests
Browse files Browse the repository at this point in the history
  • Loading branch information
eanyanwu committed Oct 23, 2024
1 parent 9a1b8dd commit 66864ac
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 27 deletions.
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
/*
import { Analytics, Context } from '@segment/analytics-next'
import plugins, { destination } from '../index'
import { mockWorkerAndXMLHttpRequest, subscriptions } from '../test_utilities'
import Logrocket from 'logrocket'
*/
//jest.mock('logrocket')

//const appID = 'log/rocket'
jest.mock('logrocket')

const appID = 'log/rocket'

describe('Logrocket', () => {
//beforeAll(mockWorkerAndXMLHttpRequest)
//afterAll(jest.restoreAllMocks)
beforeAll(mockWorkerAndXMLHttpRequest)
afterAll(jest.restoreAllMocks)

test('can load', async () => {
/*
const [event] = await plugins({
appID,
networkSanitization: false,
Expand All @@ -29,11 +27,8 @@ describe('Logrocket', () => {
expect(Logrocket.init).toHaveBeenCalled()

expect(window._LRLogger).toBeDefined()
*/
expect(true)
})

/*
test('supplies the input sanitization parameter', async () => {
const [event] = await plugins({
appID,
Expand Down Expand Up @@ -107,6 +102,4 @@ describe('Logrocket', () => {
expect(sanitizedResult).toEqual(mockRequest)
})
})
*/
})
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
/*
import { Analytics, Context } from '@segment/analytics-next'
import plugins from '../../index'
import LogRocket from 'logrocket'
import { identifySubscription, mockWorkerAndXMLHttpRequest } from '../../test_utilities'
*/

describe('Logrocket.identify', () => {
/*
const settings = { appID: 'log/rocket' }

beforeAll(mockWorkerAndXMLHttpRequest)
Expand All @@ -15,7 +12,6 @@ describe('Logrocket.identify', () => {
const traits = {
goodbye: 'moon'
}

it('should send user ID and traits to logrocket', async () => {
const [identify] = await plugins({ ...settings, subscriptions: [identifySubscription] })
Expand All @@ -35,9 +31,8 @@ describe('Logrocket.identify', () => {

expect(identifySpy).toHaveBeenCalledWith(userId, traits)
})
*/

it("shouldn't send an ID if the user is anonymous", async () => {
/*
const [identify] = await plugins({ appID: 'log/rocket', subscriptions: [identifySubscription] })

await identify.load(Context.system(), {} as Analytics)
Expand All @@ -51,7 +46,5 @@ describe('Logrocket.identify', () => {
)

expect(identifySpy).toHaveBeenCalledWith(traits)
*/
expect(true)
})
})
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
/*
import { Analytics, Context } from '@segment/analytics-next'
import plugins from '../../index'
import LogRocket from 'logrocket'
import { mockWorkerAndXMLHttpRequest, trackSubscription } from '../../test_utilities'
*/

describe('Logrocket.track', () => {
//beforeAll(mockWorkerAndXMLHttpRequest)
//afterAll(jest.restoreAllMocks)
beforeAll(mockWorkerAndXMLHttpRequest)
afterAll(jest.restoreAllMocks)
it('sends track events to logrocket', async () => {
/*
const [event] = await plugins({ appID: 'log/rocket', subscriptions: [trackSubscription] })

await event.load(Context.system(), {} as Analytics)
Expand All @@ -29,7 +26,5 @@ describe('Logrocket.track', () => {
)

expect(trackSpy).toHaveBeenCalledWith(name, properties)
*/
expect(true)
})
})

0 comments on commit 66864ac

Please sign in to comment.