Files
windmill/cli/test/workspace_deps_path_unit.test.ts
Ruben FiszelandClaude Opus 5 841f7e1436 fix(cli): sync workspace dependency files on Windows and fix CLI tests (#11288)
* fix(cli): sync workspace dependency files on Windows

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* test(cli): pin workspace dependency path parsing on both separators

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* fix(cli): classify workspace dependency files on either separator

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* test(cli): check out the fork deploy clone without autocrlf

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-22 12:13:11 +00:00

24 lines
1.1 KiB
TypeScript

import { expect, test } from "bun:test";
import { isWorkspaceDependencies } from "../src/utils/utils.ts";
import { workspaceDependenciesPathToLanguageAndFilename } from "../src/utils/script_common.ts";
// Sync paths carry the platform separator. A Windows path parsed to a different
// set name pushes the file to a set the workspace does not have.
test("workspace dependency paths parse the same with either separator", () => {
for (const sep of ["/", "\\"]) {
expect(isWorkspaceDependencies(`dependencies${sep}requirements.in`)).toBe(true);
expect(
workspaceDependenciesPathToLanguageAndFilename(`dependencies${sep}requirements.in`),
).toEqual({ name: undefined, language: "python3" });
expect(
workspaceDependenciesPathToLanguageAndFilename(`dependencies${sep}team.package.json`),
).toEqual({ name: "team", language: "bun" });
expect(
workspaceDependenciesPathToLanguageAndFilename(
`dependencies${sep}team${sep}python.requirements.in`,
),
).toEqual({ name: "team/python", language: "python3" });
}
expect(isWorkspaceDependencies("f\\dependencies\\requirements.in")).toBe(false);
});