Skip to content

Commit

Permalink
updated linting
Browse files Browse the repository at this point in the history
  • Loading branch information
jsumners-nr committed Jan 13, 2025
1 parent b5999ba commit 6170707
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 10 deletions.
3 changes: 2 additions & 1 deletion test/unit/agent/agent.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion test/unit/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
10 changes: 3 additions & 7 deletions test/unit/lib/health-reporter.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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'
Expand Down Expand Up @@ -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'
Expand Down Expand Up @@ -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'
Expand Down
2 changes: 1 addition & 1 deletion test/unit/mocks/agent.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {}) {
Expand Down

0 comments on commit 6170707

Please sign in to comment.