Skip to content

Commit

Permalink
test: Removed t.diagnostic from tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bizob2828 committed Jan 3, 2025
1 parent daa3700 commit 0a3379d
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -322,14 +322,6 @@ async function runTestCase(testCase, parentTest) {
})

await parentTest.test('trace context: ' + testCase.test_name, (t, end) => {
if (testCase.comment && testCase.comment.length > 0) {
const comment = Array.isArray(testCase.comment)
? testCase.comment.join('\n')
: testCase.comment

t.diagnostic(comment)
}

const agent = helper.instrumentMockedAgent({})
agent.recordSupportability = recordSupportability
agent.config.trusted_account_key = testCase.trusted_account_key
Expand Down
3 changes: 3 additions & 0 deletions test/integration/uninstrumented/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,8 @@
"restify": "*",
"superagent": "*",
"when": "*"
},
"engines": {
"node": ">=18"
}
}
4 changes: 2 additions & 2 deletions test/integration/uninstrumented/uninstrumented.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ test('all instrumented modules should be detected when uninstrumented', (t, end)
try {
require(module)
loaded.push(module)
} catch (err) {
t.diagnostic('failed to load ' + module)
} catch {
// silently fail
}
}
})
Expand Down
4 changes: 1 addition & 3 deletions test/lib/temp-override-uncaught.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,7 @@ const oldListeners = {
*/
function tempOverrideUncaught({ t, handler, type = EXCEPTION }) {
if (!handler) {
handler = function uncaughtTestHandler() {
t.diagnostic('uncaught handler not defined')
}
handler = function uncaughtTestHandler() {}
}

oldListeners[type] = process.listeners(type)
Expand Down
1 change: 0 additions & 1 deletion test/lib/temp-remove-listeners.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
*/
module.exports = function tempRemoveListeners({ t, emitter, event }) {
if (!emitter) {
t.diagnostic(`Not removing ${event} listeners, emitter does not exist`)
return
}

Expand Down
2 changes: 0 additions & 2 deletions test/unit/collector/facts.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -730,7 +730,6 @@ test('display_host facts', async (t) => {
await t.test('should be ipv6 when ipv_preference === 6', (t, end) => {
const { agent, facts } = t.nr
if (!agent.config.getIPAddresses().ipv6) {
t.diagnostic('this machine does not have an ipv6 address, skipping')
end()
}

Expand All @@ -753,7 +752,6 @@ test('display_host facts', async (t) => {
await t.test('returns no ipv4, hostname should be ipv6 if possible', (t, end) => {
const { agent, facts } = t.nr
if (!agent.config.getIPAddresses().ipv6) {
t.diagnostic('this machine does not have an ipv6 address, skipping')
end()
}

Expand Down

0 comments on commit 0a3379d

Please sign in to comment.