Файли
openidea/src/features/settings/__tests__/terminalLine.test.ts
T
l0ng-ai 0dafd649da fix(python): readable environment creation log and status refresh after creating one (#3837)
Tool output is shown as a terminal would show the line: backspaces erase
(conda's spinner), a carriage return rewrites the line (pip progress) and
ANSI sequences are dropped.

The interpreter status widget re-reads interpreters when one is created or
added in Settings. A conda environment lives outside the project, so no file
event announced it, and when the configured path was already set the widget
kept showing "Invalid interpreter" and an interpreter list without it.
2026-11-17 04:24:28 +08:00

16 рядки
769 B
TypeScript

import { describe, expect, it } from "vitest";
import { terminalLine } from "../languages/api";
describe("terminalLine", () => {
it.each([
["Solving environment: -\b\\\b|\b/\bdone", "Solving environment: done"],
["Downloading 10%\rDownloading 55%\rDownloading 100%", "Downloading 100%"],
["Collecting pip\r\n", "Collecting pip"],
["\x1b[32mSuccessfully installed\x1b[0m six", "Successfully installed six"],
["\x1b]0;conda\x07Preparing transaction", "Preparing transaction"],
["progress 99%\rdone", "doneress 99%"],
["\tindented\x07", "\tindented"],
])("renders %j as %j", (raw, line) => expect(terminalLine(raw)).toBe(line));
it.each(["", "\b\b", "\x1b[2K\r", " "])("drops %j", (raw) => expect(terminalLine(raw)).toBeNull());
});