Skip to content

Commit 1a20edc

Browse files
authored
chore(debugger): fix spelling and types (#7009)
1 parent b0ae6aa commit 1a20edc

30 files changed

+81
-52
lines changed

integration-tests/debugger/basic.spec.js

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -194,24 +194,24 @@ describe('Dynamic Instrumentation', function () {
194194

195195
it(
196196
'should send expected error diagnostics messages if probe doesn\'t conform to expected schema',
197-
unsupporedOrInvalidProbesTest({ invalid: 'config' }, { status: 'ERROR' })
197+
unsupportedOrInvalidProbesTest({ invalid: 'config' }, { status: 'ERROR' })
198198
)
199199

200200
it(
201201
'should send expected error diagnostics messages if probe type isn\'t supported',
202202
// @ts-expect-error Expecting this probe type to be invalid
203-
unsupporedOrInvalidProbesTest(t.generateProbeConfig({ type: 'INVALID_PROBE' }))
203+
unsupportedOrInvalidProbesTest(t.generateProbeConfig({ type: 'INVALID_PROBE' }))
204204
)
205205

206206
it(
207207
'should send expected error diagnostics messages if it isn\'t a line-probe',
208-
unsupporedOrInvalidProbesTest(
208+
unsupportedOrInvalidProbesTest(
209209
// @ts-expect-error Expecting this probe type to be invalid
210210
t.generateProbeConfig({ where: { typeName: 'index.js', methodName: 'handlerA' } })
211211
)
212212
)
213213

214-
function unsupporedOrInvalidProbesTest (config, customErrorDiagnosticsObj) {
214+
function unsupportedOrInvalidProbesTest (config, customErrorDiagnosticsObj) {
215215
return function (done) {
216216
let receivedAckUpdate = false
217217

@@ -369,7 +369,7 @@ describe('Dynamic Instrumentation', function () {
369369
t.agent.addRemoteConfig(rcConfig2)
370370
})
371371

372-
it('should only trigger the probes whos conditions are met (all have conditions)', function (done) {
372+
it('should only trigger the probes whose conditions are met (all have conditions)', function (done) {
373373
let installed = 0
374374
const rcConfig1 = t.generateRemoteConfig({
375375
when: { json: { eq: [{ getmember: [{ getmember: [{ ref: 'request' }, 'params'] }, 'name'] }, 'invalid'] } }
@@ -450,7 +450,7 @@ describe('Dynamic Instrumentation', function () {
450450
}
451451
})
452452

453-
it('should only trigger the probes whos conditions are met (not all have conditions)', function (done) {
453+
it('should only trigger the probes whose conditions are met (not all have conditions)', function (done) {
454454
let installed = 0
455455
const rcConfig1 = t.generateRemoteConfig({
456456
when: { json: { eq: [{ getmember: [{ getmember: [{ ref: 'request' }, 'params'] }, 'name'] }, 'invalid'] } }
@@ -539,7 +539,7 @@ describe('Dynamic Instrumentation', function () {
539539
t.agent.on('debugger-diagnostics', ({ payload }) => {
540540
payload.forEach((event) => {
541541
if (event.debugger.diagnostics.status === 'INSTALLED') {
542-
t.agent.once('remote-confg-responded', async () => {
542+
t.agent.once('remote-config-responded', async () => {
543543
await t.axios.get(t.breakpoint.url)
544544
// We want to wait enough time to see if the client triggers on the breakpoint so that the test can fail
545545
// if it does, but not so long that the test times out.
@@ -607,23 +607,23 @@ describe('Dynamic Instrumentation', function () {
607607
const rcConfig2 = t.breakpoints[1].generateRemoteConfig({ sampling: { snapshotsPerSecond: 1 } })
608608
const state = {
609609
[rcConfig1.config.id]: {
610-
tiggerBreakpointContinuously () {
610+
triggerBreakpointContinuously () {
611611
t.axios.get(t.breakpoints[0].url).catch(done)
612-
this.timer = setTimeout(this.tiggerBreakpointContinuously.bind(this), 10)
612+
this.timer = setTimeout(this.triggerBreakpointContinuously.bind(this), 10)
613613
}
614614
},
615615
[rcConfig2.config.id]: {
616-
tiggerBreakpointContinuously () {
616+
triggerBreakpointContinuously () {
617617
t.axios.get(t.breakpoints[1].url).catch(done)
618-
this.timer = setTimeout(this.tiggerBreakpointContinuously.bind(this), 10)
618+
this.timer = setTimeout(this.triggerBreakpointContinuously.bind(this), 10)
619619
}
620620
}
621621
}
622622

623623
t.agent.on('debugger-diagnostics', ({ payload }) => {
624624
payload.forEach((event) => {
625625
const { probeId, status } = event.debugger.diagnostics
626-
if (status === 'INSTALLED') state[probeId].tiggerBreakpointContinuously()
626+
if (status === 'INSTALLED') state[probeId].triggerBreakpointContinuously()
627627
})
628628
})
629629

@@ -741,7 +741,7 @@ describe('Dynamic Instrumentation', function () {
741741
t.axios.get(t.breakpoint.url).catch((err) => {
742742
// If the request hasn't fully completed by the time the tests ends and the target app is destroyed,
743743
// Axios will complain with a "socket hang up" error. Hence this sanity check before calling
744-
// `done(err)`. If we later add more tests below this one, this shouuldn't be an issue.
744+
// `done(err)`. If we later add more tests below this one, this shouldn't be an issue.
745745
if (!finished) done(err)
746746
})
747747
}
@@ -909,7 +909,7 @@ function assertBasicInputPayload (t, payload, probe = t.rcConfig.config) {
909909
assert.isAbove(frame.columnNumber, 0)
910910
}
911911
const topFrame = payload.debugger.snapshot.stack[0]
912-
// path seems to be prefeixed with `/private` on Mac
912+
// path seems to be prefixed with `/private` on Mac
913913
assert.match(topFrame.fileName, new RegExp(`${t.appFile}$`))
914914
assert.strictEqual(topFrame.function, 'fooHandler')
915915
assert.strictEqual(topFrame.lineNumber, t.breakpoint.line)

integration-tests/debugger/re-evaluation.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const { generateProbeConfig } = require('../../packages/dd-trace/test/debugger/d
2121
// breakpoint is never exercised during the test, and the tracer therefore never emits the `EMITTING` event.
2222
//
2323
// This is only really an issue if Node.js is using the ESM loader, as this is really slow. If the application is
24-
// purely a CommonJS application, this race condtion will probably never be triggered.
24+
// purely a CommonJS application, this race condition will probably never be triggered.
2525
//
2626
// This test tries to trigger the race condition. However, it doesn't always happen, so it runs multiple times.
2727
describe('Dynamic Instrumentation Probe Re-Evaluation', function () {

integration-tests/debugger/snapshot-global-sample-rate.spec.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,15 @@ describe('Dynamic Instrumentation', function () {
2828
// Two breakpoints, each triggering a request every 10ms, so we should get 200 requests per second
2929
const state = {
3030
[rcConfig1.config.id]: {
31-
tiggerBreakpointContinuously () {
31+
triggerBreakpointContinuously () {
3232
t.axios.get(t.breakpoints[0].url).catch(done)
33-
this.timer = setTimeout(this.tiggerBreakpointContinuously.bind(this), 10)
33+
this.timer = setTimeout(this.triggerBreakpointContinuously.bind(this), 10)
3434
}
3535
},
3636
[rcConfig2.config.id]: {
37-
tiggerBreakpointContinuously () {
37+
triggerBreakpointContinuously () {
3838
t.axios.get(t.breakpoints[1].url).catch(done)
39-
this.timer = setTimeout(this.tiggerBreakpointContinuously.bind(this), 10)
39+
this.timer = setTimeout(this.triggerBreakpointContinuously.bind(this), 10)
4040
}
4141
}
4242
}
@@ -45,7 +45,7 @@ describe('Dynamic Instrumentation', function () {
4545
payload.forEach((event) => {
4646
const { probeId, status } = event.debugger.diagnostics
4747
if (status === 'INSTALLED') {
48-
state[probeId].tiggerBreakpointContinuously()
48+
state[probeId].triggerBreakpointContinuously()
4949
}
5050
})
5151
})

integration-tests/debugger/source-map-support.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const { setup } = require('./utils')
55

66
describe('Dynamic Instrumentation', function () {
77
describe('source map support', function () {
8-
describe('Different file extention (TypeScript)', function () {
8+
describe('Different file extension (TypeScript)', function () {
99
const t = setup({
1010
testApp: 'target-app/source-map-support/typescript.js',
1111
testAppSource: 'target-app/source-map-support/typescript.ts'
@@ -38,7 +38,7 @@ describe('Dynamic Instrumentation', function () {
3838
t.agent.on('debugger-input', ({ payload: [{ debugger: { snapshot: { probe: { location } } } }] }) => {
3939
assert.deepEqual(location, {
4040
file: 'target-app/source-map-support/minify.js',
41-
lines: ['8']
41+
lines: ['9']
4242
})
4343
done()
4444
})

integration-tests/debugger/target-app/basic.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
'use strict'
22

3+
// @ts-expect-error This code is running in a sandbox where dd-trace is available
34
require('dd-trace/init')
45
// @ts-expect-error This code is running in a sandbox where fastify is available
56
const Fastify = require('fastify')

integration-tests/debugger/target-app/custom-logger.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
'use strict'
22

3+
// @ts-expect-error This code is running in a sandbox where dd-trace is available
34
require('dd-trace').init({
45
logger: {
56
error: (...args) => console.log('[CUSTOM LOGGER][ERROR]:', ...args), // eslint-disable-line no-console

integration-tests/debugger/target-app/redact.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
'use strict'
22

3+
// @ts-expect-error This code is running in a sandbox where dd-trace is available
34
require('dd-trace/init')
45
// @ts-expect-error This code is running in a sandbox where fastify is available
56
const Fastify = require('fastify')

integration-tests/debugger/target-app/snapshot-pruning.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
'use strict'
22

3+
// @ts-expect-error This code is running in a sandbox where dd-trace is available
34
require('dd-trace/init')
45

56
const { randomBytes } = require('crypto')

integration-tests/debugger/target-app/snapshot-time-budget.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
'use strict'
22

3+
// @ts-expect-error This code is running in a sandbox where dd-trace is available
34
require('dd-trace/init')
45

56
// @ts-expect-error This code is running in a sandbox where fastify is available

integration-tests/debugger/target-app/snapshot.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
'use strict'
22

3+
// @ts-expect-error This code is running in a sandbox where dd-trace is available
34
require('dd-trace/init')
45
// @ts-expect-error This code is running in a sandbox where fastify is available
56
const Fastify = require('fastify')

0 commit comments

Comments
 (0)