Skip to content

Commit

Permalink
chore: Migrate block of unit tests to node:test (#2593)
Browse files Browse the repository at this point in the history
  • Loading branch information
jsumners-nr authored Sep 23, 2024
1 parent 444e48b commit 6d4d49e
Show file tree
Hide file tree
Showing 11 changed files with 1,466 additions and 1,517 deletions.
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

0 comments on commit 6d4d49e

Please sign in to comment.