Skip to content

Commit

Permalink
test: Removed t.diagnostic from tests (#2858)
Browse files Browse the repository at this point in the history
  • Loading branch information
bizob2828 authored Jan 3, 2025
1 parent d2fba9d commit 23ca237
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -326,14 +326,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"
}
}
2 changes: 1 addition & 1 deletion test/integration/uninstrumented/uninstrumented.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ test('all instrumented modules should be detected when uninstrumented', (t, end)
require(module)
loaded.push(module)
} catch {
t.diagnostic('failed to load ' + module)
// 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 @@ -34,9 +34,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 @@ -19,7 +19,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 23ca237

Please sign in to comment.