(fixture: ParserFixture)
| 41 | } |
| 42 | |
| 43 | async function parseFixture(fixture: ParserFixture): Promise<ParseResult> { |
| 44 | const dir = mkdtempSync(join(tmpdir(), 'chatlab-parser-fixture-')) |
| 45 | try { |
| 46 | const filePath = join(dir, fixture.filename) |
| 47 | writeFileSync(filePath, fixture.content, 'utf-8') |
| 48 | |
| 49 | assert.equal(detectFormat(filePath)?.id, fixture.formatId) |
| 50 | return await parseFileSync(filePath) |
| 51 | } finally { |
| 52 | rmSync(dir, { recursive: true, force: true }) |
| 53 | } |
| 54 | } |
| 55 | |
| 56 | const fixtures: ParserFixture[] = [ |
| 57 | { |
no test coverage detected