mirror of
https://github.com/JackChen-me/open-multi-agent.git
synced 2026-10-23 03:24:25 -05:00
* chore(observability): complete OBS-5 release readiness * docs(observability): add v2 architecture to core readme
30 lines
1.1 KiB
TypeScript
30 lines
1.1 KiB
TypeScript
import { fileURLToPath } from 'node:url'
|
|
import ts from 'typescript'
|
|
import { describe, expect, it } from 'vitest'
|
|
|
|
describe('public Observability v2 examples', () => {
|
|
it('typechecks every snippet through public package and subpath imports', () => {
|
|
const configPath = fileURLToPath(new URL(
|
|
'../examples/integrations/observability-v2/tsconfig.json',
|
|
import.meta.url,
|
|
))
|
|
const loaded = ts.readConfigFile(configPath, ts.sys.readFile)
|
|
expect(loaded.error).toBeUndefined()
|
|
const parsed = ts.parseJsonConfigFileContent(
|
|
loaded.config,
|
|
ts.sys,
|
|
fileURLToPath(new URL('../examples/integrations/observability-v2', import.meta.url)),
|
|
undefined,
|
|
configPath,
|
|
)
|
|
const program = ts.createProgram(parsed.fileNames, parsed.options)
|
|
const diagnostics = ts.getPreEmitDiagnostics(program)
|
|
const formatted = ts.formatDiagnosticsWithColorAndContext(diagnostics, {
|
|
getCanonicalFileName: (fileName) => fileName,
|
|
getCurrentDirectory: ts.sys.getCurrentDirectory,
|
|
getNewLine: () => ts.sys.newLine,
|
|
})
|
|
expect(formatted).toBe('')
|
|
})
|
|
})
|