Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion src/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,19 @@ import { commandExists } from "./utils/shell.js";
import { isZshShell } from "./utils/shell-context.js";
export { isZshShell } from "./utils/shell-context.js";

export const SUITUP_ASCII_LOGO = String.raw`
_____ _ __
/ ___/__ __(_) /___ ______
\__ \/ / / / / __/ / / / __ \
___/ / /_/ / / /_/ /_/ / /_/ /
/____/\__,_/_/\__/\__,_/ .___/
/_/
`.trim();

export function getWelcomeMessage() {
return `${pc.cyan(SUITUP_ASCII_LOGO)}\n${pc.bgCyan(pc.black(" Suit up! "))}`;
}

export function getRecommendedCliToolValues() {
return [...CLI_TOOLS.essentials, ...CLI_TOOLS.shell].map((tool) => tool.value);
}
Expand Down Expand Up @@ -126,7 +139,7 @@ export function getInitialStepValues(opts = {}) {
}

export async function runSetup({ defaults = false } = {}) {
p.intro(pc.bgCyan(pc.black(" Suit up! ")));
p.intro(getWelcomeMessage());

if (!isZshShell()) {
p.log.error("Suitup setup must be run from zsh.");
Expand Down
10 changes: 10 additions & 0 deletions tests/setup.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import {
getInitialStepValues,
getRecommendedAppValues,
getRecommendedCliToolValues,
getWelcomeMessage,
isZshShell,
} from "../src/setup.js";

Expand Down Expand Up @@ -163,6 +164,15 @@ describe("Setup simulation in sandbox", () => {
]);
});

test("welcome message includes the ASCII suitup mark", () => {
const message = getWelcomeMessage();

expect(message).toContain("_____ _ __");
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里用 inline snapshot,这样比较直观 @copilot

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已改成 inline snapshot,提交在 e4f5df3

截图:https://github.com/user-attachments/assets/baa86228-9827-42b5-a7e4-c80003a80df0

expect(message).toContain("/ ___/__ __(_) /___ ______");
expect(message).toContain("/____/\\__,_/_/\\__/\\__,_/ .___/");
expect(message).toContain("Suit up!");
});

test("detects completed suitup-managed setup steps", () => {
mkdirSync(join(sandbox, ".config", "zsh", "core"), { recursive: true });
mkdirSync(join(sandbox, ".config", "zsh", "shared"), { recursive: true });
Expand Down
Loading