diff --git a/README.md b/README.md index 1b0b2e5..2caed28 100644 --- a/README.md +++ b/README.md @@ -51,7 +51,7 @@ npx @microsoft/tui-test ### Multi-platform / Multi-shell • No more "it works in my shell" -**Multi-platform**. TUI Test supports testing on macOS, Linux, and Windows with a wide range of shells when installed: `cmd`, `windows powershell`, `powershell`, `bash`, `git-bash`, `fish`, and `zsh`. +**Multi-platform**. TUI Test supports testing on macOS, Linux, and Windows with a wide range of shells when installed: `cmd`, `windows powershell`, `powershell`, `bash`, `git-bash`, `fish`, `zsh`, and `xonsh`. **Wide-support**. TUI Test uses [xterm.js](https://xtermjs.org/) to render the terminal, which is a widely used terminal emulator in projects like [VSCode](https://github.com/microsoft/vscode) and [Hyper](https://github.com/vercel/hyper). @@ -96,7 +96,7 @@ This code snippet shows how to use rich assertions of the terminal. import { test, expect } from "@microsoft/tui-test"; test("make a regex assertion", async ({ terminal }) => { - terminal.write("ls -l\r") + terminal.submit("ls -l") await expect(terminal.getByText(/total [0-9]{3}/g)).toBeVisible(); }); diff --git a/examples/assertions.test.ts b/examples/assertions.test.ts index 8eb8540..9532733 100644 --- a/examples/assertions.test.ts +++ b/examples/assertions.test.ts @@ -6,21 +6,21 @@ import { test, expect, Shell } from "@microsoft/tui-test"; test.use({ shell: Shell.Powershell }); test("make a regex assertion", async ({ terminal }) => { - terminal.write("dir | measure\r"); + terminal.submit("dir | measure"); await expect(terminal.getByText(/Count\s*:\s*[0-9]{2}/g)).toBeVisible(); }); test("make a text assertion", async ({ terminal }) => { - terminal.write("echo 1\r"); + terminal.submit("echo 1"); await expect(terminal.getByText("1")).toBeVisible(); }); test("make a negative text assertion", async ({ terminal }) => { - terminal.write("echo 1\r"); + terminal.submit("echo 1"); await expect(terminal.getByText("1")).toBeVisible(); - terminal.write("clear\r"); + terminal.submit("clear"); await expect(terminal.getByText("clear")).not.toBeVisible(); });