mirror of
https://github.com/getpaseo/paseo.git
synced 2026-10-27 11:42:52 +00:00
* fix(workspaces): preserve spaces in project directory names Git path output and app workspace descriptors each stripped significant path whitespace. Preserve directory names while retaining single-record Git output validation and workspace separator normalization. * test(workspaces): capture Changes after files appear * test(workspaces): release fixtures when setup fails --------- Co-authored-by: paseo-bot[bot] <266920839+paseo-bot[bot]@users.noreply.github.com>
27 lines
909 B
TypeScript
27 lines
909 B
TypeScript
import { resolve } from "node:path";
|
|
import { describe, expect, it } from "vitest";
|
|
import { parseGitRevParsePath, resolveGitRevParsePath } from "./git-rev-parse-path.js";
|
|
|
|
describe("Git path output", () => {
|
|
it.each(["\n", "\r\n", ""])("preserves path whitespace with delimiter %j", (delimiter) => {
|
|
expect(parseGitRevParsePath(`/repo ${delimiter}`)).toBe("/repo ");
|
|
expect(parseGitRevParsePath(` relative path ${delimiter}`)).toBe(" relative path ");
|
|
});
|
|
|
|
it.each([
|
|
"",
|
|
"\n",
|
|
"\r\n",
|
|
"--path-format=absolute\n",
|
|
"--path-format=absolute\n/repo\n",
|
|
"/repo\n/another\n",
|
|
"/repo\n\n",
|
|
])("rejects invalid output %j", (output) => {
|
|
expect(parseGitRevParsePath(output)).toBeNull();
|
|
});
|
|
|
|
it("resolves a relative path without stripping its trailing space", () => {
|
|
expect(resolveGitRevParsePath("/base", "repo \n")).toBe(resolve("/base", "repo "));
|
|
});
|
|
});
|