testStackFramesAreRead

tcmts.cli.main.testStackFramesAreRead · #m54mphkn · term

import { stackFrames } from "#codebase/tcmts/cli/main";
import assert from "node:assert/strict";

export const testStackFramesAreRead = () => {
  assert.deepEqual(
    stackFrames(
      [
        "Error: no post 1",
        "    at parse (/Users/a/Application Support/app/.tcm/src/board/parse.ts:3:9)",
        "    at file:///Users/a/app/.tcm/cache/x.ts:7:10",
        "    at AsyncLocalStorage.run (node:internal/async_local_storage/async_context_frame:63:14)",
        "press@http://127.0.0.1:5173/@fs/Users/a/My%20App/.tcm/cache/h.ts?v=1:2:9",
        "    at http://127.0.0.1:8080/_app/assets/app-abc.js:1:200",
      ].join("\n"),
    ),
    [
      { file: "/Users/a/Application Support/app/.tcm/src/board/parse.ts", line: 3, column: 9 },
      { file: "/Users/a/app/.tcm/cache/x.ts", line: 7, column: 10 },
      { file: "/Users/a/My App/.tcm/cache/h.ts", line: 2, column: 9 },
      { asset: "app-abc.js", line: 1, column: 200 },
    ],
  );
}

uses