File size: 581 Bytes
3e05655
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import { expect, test } from "bun:test"
import { mkdtemp, rm } from "node:fs/promises"
import path from "node:path"
import os from "node:os"
import { prepareChromeTrace } from "../chrome-trace"

test("creates the configured trace directory", async () => {
  const root = await mkdtemp(path.join(os.tmpdir(), "opencode-trace-"))
  try {
    const file = await prepareChromeTrace(path.join(root, "nested", "traces"), "session/tab", false, "test")
    expect(file).toEndWith("-session-tab-458ed9e3-test.json")
  } finally {
    await rm(root, { recursive: true, force: true })
  }
})