Skip to content

Commit 7685707

Browse files
committed
regroup tests
1 parent 5090323 commit 7685707

File tree

1 file changed

+27
-26
lines changed

1 file changed

+27
-26
lines changed

packages/core/src/test/shared/utilities/processUtils.test.ts

Lines changed: 27 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -524,39 +524,40 @@ describe('ChildProcessTracker', function () {
524524
})
525525
})
526526

527-
it('logAllUsage includes only active processes', async function () {
528-
const runningProcess1 = startSleepProcess()
529-
const runningProcess2 = startSleepProcess()
527+
describe('logAllUsage', function () {
528+
it('includes only active processes', async function () {
529+
const runningProcess1 = startSleepProcess()
530+
const runningProcess2 = startSleepProcess()
530531

531-
assert.ok(tracker.has(runningProcess1.childProcess), 'Missing first process')
532-
assert.ok(tracker.has(runningProcess2.childProcess), 'Missing seconds process')
532+
assert.ok(tracker.has(runningProcess1.childProcess), 'Missing first process')
533+
assert.ok(tracker.has(runningProcess2.childProcess), 'Missing seconds process')
533534

534-
await stopAndWait(runningProcess1)
535+
await stopAndWait(runningProcess1)
535536

536-
await tracker.logAllUsage()
537-
console.log('logAllUsage called')
538-
assert.throws(() => assertLogsContain(runningProcess1.childProcess.pid().toString(), false, 'info'))
539-
assertLogsContain(runningProcess2.childProcess.pid().toString(), false, 'info')
540-
})
537+
await tracker.logAllUsage()
538+
assert.throws(() => assertLogsContain(runningProcess1.childProcess.pid().toString(), false, 'info'))
539+
assertLogsContain(runningProcess2.childProcess.pid().toString(), false, 'info')
540+
})
541541

542-
it('logAllUsage defaults to empty message when empty', async function () {
543-
await tracker.logAllUsage()
544-
assertLogsContain('No Active Subprocesses', false, 'info')
545-
})
542+
it('defaults to empty message when empty', async function () {
543+
await tracker.logAllUsage()
544+
assertLogsContain('No Active Subprocesses', false, 'info')
545+
})
546546

547-
it('logAllUsage emits telemetry with size equal to number of processes (empty)', async function () {
548-
await tracker.logAllUsage()
549-
assertTelemetry('ide_logActiveProcesses', { size: 0 })
550-
})
547+
it('emits telemetry with size equal to number of processes (empty)', async function () {
548+
await tracker.logAllUsage()
549+
assertTelemetry('ide_logActiveProcesses', { size: 0 })
550+
})
551551

552-
it('logsAllUsage emits telemetry to number of processes (nonempty)', async function () {
553-
const size = 10
554-
for (const _ of Array.from({ length: size })) {
555-
startSleepProcess()
556-
}
552+
it('emits telemetry to number of processes (nonempty)', async function () {
553+
const size = 10
554+
for (const _ of Array.from({ length: size })) {
555+
startSleepProcess()
556+
}
557557

558-
await tracker.logAllUsage()
559-
assertTelemetry('ide_logActiveProcesses', { size: size })
558+
await tracker.logAllUsage()
559+
assertTelemetry('ide_logActiveProcesses', { size: size })
560+
})
560561
})
561562

562563
it('getProcessAsStr logs warning when its missing', async function () {

0 commit comments

Comments
 (0)