|
1 | | -import { createAuditContext } from '../src/test-utils/audit.js'; |
| 1 | +import { assertTelemetry, createAuditContext } from '../src/test-utils/audit.js'; |
2 | 2 | import { createTestProject, readProjectConfig, runCLI } from '../src/test-utils/index.js'; |
3 | 3 | import type { TestProject } from '../src/test-utils/index.js'; |
4 | 4 | import { afterAll, beforeAll, describe, expect, it } from 'vitest'; |
@@ -42,10 +42,7 @@ describe('integration: add and remove resources', () => { |
42 | 42 | expect(found, `Memory "${memoryName}" should be in config`).toBe(true); |
43 | 43 |
|
44 | 44 | // Verify telemetry |
45 | | - const entries = audit.readEntries(); |
46 | | - const memEntry = entries.find(e => e.attrs.command === 'add.memory'); |
47 | | - expect(memEntry).toBeDefined(); |
48 | | - expect(memEntry!.attrs).toMatchObject({ command: 'add.memory', exit_reason: 'success' }); |
| 45 | + assertTelemetry(audit.readEntries(), { command: 'add.memory', exit_reason: 'success' }); |
49 | 46 | }); |
50 | 47 |
|
51 | 48 | it('adds a memory with EPISODIC strategy and verifies reflectionNamespaces', async () => { |
@@ -114,10 +111,7 @@ describe('integration: add and remove resources', () => { |
114 | 111 | expect(found, `Credential "${credentialName}" should be in config`).toBe(true); |
115 | 112 |
|
116 | 113 | // Verify telemetry |
117 | | - const entries = audit.readEntries(); |
118 | | - const credEntry = entries.find(e => e.attrs.command === 'add.credential'); |
119 | | - expect(credEntry).toBeDefined(); |
120 | | - expect(credEntry!.attrs).toMatchObject({ |
| 114 | + assertTelemetry(audit.readEntries(), { |
121 | 115 | command: 'add.credential', |
122 | 116 | exit_reason: 'success', |
123 | 117 | credential_type: 'api-key', |
|
0 commit comments