From 617070705b02953855f5ed2dc6e755075fb09490 Mon Sep 17 00:00:00 2001 From: James Sumners Date: Mon, 13 Jan 2025 09:55:05 -0500 Subject: [PATCH] updated linting --- test/unit/agent/agent.test.js | 3 ++- test/unit/index.test.js | 2 +- test/unit/lib/health-reporter.test.js | 10 +++------- test/unit/mocks/agent.js | 2 +- 4 files changed, 7 insertions(+), 10 deletions(-) diff --git a/test/unit/agent/agent.test.js b/test/unit/agent/agent.test.js index d11c99422f..40136acf84 100644 --- a/test/unit/agent/agent.test.js +++ b/test/unit/agent/agent.test.js @@ -24,7 +24,8 @@ const path = require('node:path') process.env.NEW_RELIC_SUPERAGENT_FLEET_ID = 42 process.env.NEW_RELIC_SUPERAGENT_HEALTH_DELIVERY_LOCATION = os.tmpdir() process.env.NEW_RELIC_SUPERAGENT_HEALTH_FREQUENCY = 1 -const HealthReporter = require('../../../lib/health-reporter') +const HealthReporter = require('#agentlib/health-reporter.js') + test.after(() => { const files = fs.readdirSync(process.env.NEW_RELIC_SUPERAGENT_HEALTH_DELIVERY_LOCATION) for (const file of files) { diff --git a/test/unit/index.test.js b/test/unit/index.test.js index 5b6cd7b616..872823062b 100644 --- a/test/unit/index.test.js +++ b/test/unit/index.test.js @@ -11,7 +11,7 @@ const tspl = require('@matteo.collina/tspl') const sinon = require('sinon') -const HealthReporter = require('../../lib/health-reporter') +const HealthReporter = require('#agentlib/health-reporter.js') const proxyquire = require('proxyquire').noCallThru() const createLoggerMock = require('./mocks/logger') const createMockAgent = require('./mocks/agent') diff --git a/test/unit/lib/health-reporter.test.js b/test/unit/lib/health-reporter.test.js index bc473d103f..36c0364779 100644 --- a/test/unit/lib/health-reporter.test.js +++ b/test/unit/lib/health-reporter.test.js @@ -12,10 +12,6 @@ const fs = require('node:fs') const tspl = require('@matteo.collina/tspl') const match = require('../../lib/custom-assertions/match') - -// TODO: testing this out. Current eslint config doesn't allow for it. If -// it doesn't cause issues, then I'll investigate how to fix the suppression. -// eslint-disable-next-line node/no-missing-require const HealthReporter = require('#agentlib/health-reporter.js') function simpleInterval(method) { @@ -123,7 +119,7 @@ test('initializes and writes to destination', async (t) => { data, [ 'healthy: true', - `status: 'Healthy.'`, + "status: 'Healthy.'", 'last_error: NR-APM-000', 'start_time_unix_nano: 1', 'status_time_unix_nano: 2' @@ -214,7 +210,7 @@ test('stop leaves last error code in place', async (t) => { data, [ 'healthy: false', - `status: 'HTTP error communicating with New Relic.'`, + "status: 'HTTP error communicating with New Relic.'", 'last_error: NR-APM-004', 'start_time_unix_nano: 1', 'status_time_unix_nano: 3' @@ -246,7 +242,7 @@ test('stop sets shutdown status', async (t) => { data, [ 'healthy: true', - `status: 'Agent has shutdown.'`, + "status: 'Agent has shutdown.'", 'last_error: NR-APM-099', 'start_time_unix_nano: 1', 'status_time_unix_nano: 3' diff --git a/test/unit/mocks/agent.js b/test/unit/mocks/agent.js index 4bb39d447c..4ce6b7243f 100644 --- a/test/unit/mocks/agent.js +++ b/test/unit/mocks/agent.js @@ -8,7 +8,7 @@ const { EventEmitter } = require('events') const util = require('util') const sinon = require('sinon') -const HealthReporter = require('../../../lib/health-reporter') +const HealthReporter = require('#agentlib/health-reporter.js') module.exports = (sandbox = sinon, metricsMock) => { function MockAgent(config = {}) {