Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

chore: Migrate block of unit tests to node:test #2593

Merged
merged 9 commits into from
Sep 23, 2024
Merged
Show file tree
Hide file tree
Changes from 8 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
4 changes: 2 additions & 2 deletions lib/collector/facts.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
'use strict'

const fetchSystemInfo = require('../system-info')
const logger = require('../logger').child({ component: 'facts' })
const defaultLogger = require('../logger').child({ component: 'facts' })
const os = require('os')
const parseLabels = require('../util/label-parser')

module.exports = facts

async function facts(agent, callback) {
async function facts(agent, callback, { logger = defaultLogger } = {}) {
const startTime = Date.now()

const systemInfoPromise = new Promise((resolve) => {
Expand Down
1 change: 1 addition & 0 deletions lib/util/label-parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ function truncate(str, max) {
for (i = 0; i < str.length; ++i) {
const chr = str.charCodeAt(i)
if (chr >= 0xd800 && chr <= 0xdbff && i !== str.length) {
// Handle UTF-16 surrogate pairs.
i += 1
}

Expand Down
Loading
Loading