Skip to content

Commit

Permalink
chore: Convert err/circular.test.js from JIL to WDIO - NEWRELIC-9031 (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
bjfield authored Jun 15, 2023
1 parent a717951 commit 3d49a65
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 55 deletions.
54 changes: 0 additions & 54 deletions tests/functional/err/circular.test.js

This file was deleted.

12 changes: 12 additions & 0 deletions tests/specs/err/circular.e2e.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
describe('circular references', () => {
it('are encoded properly when error message contains a circular reference', async () => {
const [errorsResults] = await Promise.all([
browser.testHandle.expectErrors(),
browser.url(await browser.testHandle.assetURL('circular.html'))
.then(() => browser.waitForAgentLoad())
])

expect(errorsResults.request.body.err.length).toBe(1) // exactly one error
expect(errorsResults.request.body.err[0].params.message).toBe('[object Object]')
})
})
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ const config = {
}
}

describe('Error payloads', () => {
describe('error payloads', () => {
afterEach(async () => {
await browser.destroyAgentSession()
})

it('should add session replay flag if active', async () => {
await browser.url(await browser.testHandle.assetURL('instrumented.html', config)) // Setup expects before loading the page
.then(() => browser.waitForAgentLoad())
Expand Down

0 comments on commit 3d49a65

Please sign in to comment.