tui-test icon indicating copy to clipboard operation
tui-test copied to clipboard

Error showing trace for failing test

Open juanibiapina opened this issue 1 year ago • 0 comments

Hi, this looks like a really interesting project! It could be what I've been looking for to test completions for a CLI. For now though, I can't show traces of failing tests:

test file:

import { test, expect } from "@microsoft/tui-test";

test.use({ shell: "bash" });

test("ls test", async ({ terminal }) => {
  terminal.submit("ls");

  await expect(terminal.getByText("not there", { full: true })).toBeVisible();
});

This test fails, and then when trying to show the trace:

> tui-test show-trace tui-traces/test-main.test.js-ls-test

node:internal/process/promises:391
    triggerUncaughtException(err, true /* fromPromise */);
    ^

Error: unexpected end of file
    at genericNodeError (node:internal/errors:984:15)
    at wrappedFn (node:internal/errors:538:14)
    at Zlib.zlibOnError [as onerror] (node:zlib:191:17) {
  errno: -5,
  code: 'Z_BUF_ERROR'
}

Node.js v20.17.0

juanibiapina avatar Oct 08 '24 21:10 juanibiapina