Skip to content

fix: update snapshot tests for suggestion and path prompts #319

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all 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
5 changes: 5 additions & 0 deletions .changeset/stale-avocados-watch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@clack/prompts": patch
---

Updates terminal output snapshots to match new error handling and display format.
80 changes: 48 additions & 32 deletions packages/prompts/test/__snapshots__/path.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -143,17 +143,21 @@ exports[`text (isCI = false) > renders submitted value 1`] = `

exports[`text (isCI = false) > validation errors render and clear (using Error) 1`] = `
[
"<cursor.hide>",
"<cursor.backward count=999>",
"",
"<erase.down>",
"│
◆ foo
│ /tmp/foo
└
▲ foo
│ /tmp/foo
└ should be /tmp/bar
",
"<cursor.backward count=999><cursor.up count=4>",
"<cursor.down count=2>",
"<erase.line><cursor.left count=1>",
"│ /tmp/b ",
"<cursor.down count=2>",
"<cursor.down count=1>",
"<erase.down>",
"◆ foo
│ /tmp/b 
└
",
"<cursor.backward count=999><cursor.up count=4>",
"<cursor.down count=1>",
"<erase.down>",
Expand Down Expand Up @@ -186,17 +190,21 @@ exports[`text (isCI = false) > validation errors render and clear (using Error)

exports[`text (isCI = false) > validation errors render and clear 1`] = `
[
"<cursor.hide>",
"<cursor.backward count=999>",
"",
"<erase.down>",
"│
◆ foo
│ /tmp/foo
└
▲ foo
│ /tmp/foo
└ should be /tmp/bar
",
"<cursor.backward count=999><cursor.up count=4>",
"<cursor.down count=2>",
"<erase.line><cursor.left count=1>",
"│ /tmp/b ",
"<cursor.down count=2>",
"<cursor.down count=1>",
"<erase.down>",
"◆ foo
│ /tmp/b 
└
",
"<cursor.backward count=999><cursor.up count=4>",
"<cursor.down count=1>",
"<erase.down>",
Expand Down Expand Up @@ -370,17 +378,21 @@ exports[`text (isCI = true) > renders submitted value 1`] = `

exports[`text (isCI = true) > validation errors render and clear (using Error) 1`] = `
[
"<cursor.hide>",
"<cursor.backward count=999>",
"",
"<erase.down>",
"│
◆ foo
│ /tmp/foo
└
▲ foo
│ /tmp/foo
└ should be /tmp/bar
",
"<cursor.backward count=999><cursor.up count=4>",
"<cursor.down count=2>",
"<erase.line><cursor.left count=1>",
"│ /tmp/b ",
"<cursor.down count=2>",
"<cursor.down count=1>",
"<erase.down>",
"◆ foo
│ /tmp/b 
└
",
"<cursor.backward count=999><cursor.up count=4>",
"<cursor.down count=1>",
"<erase.down>",
Expand Down Expand Up @@ -413,17 +425,21 @@ exports[`text (isCI = true) > validation errors render and clear (using Error) 1

exports[`text (isCI = true) > validation errors render and clear 1`] = `
[
"<cursor.hide>",
"<cursor.backward count=999>",
"",
"<erase.down>",
"│
◆ foo
│ /tmp/foo
└
▲ foo
│ /tmp/foo
└ should be /tmp/bar
",
"<cursor.backward count=999><cursor.up count=4>",
"<cursor.down count=2>",
"<erase.line><cursor.left count=1>",
"│ /tmp/b ",
"<cursor.down count=2>",
"<cursor.down count=1>",
"<erase.down>",
"◆ foo
│ /tmp/b 
└
",
"<cursor.backward count=999><cursor.up count=4>",
"<cursor.down count=1>",
"<erase.down>",
Expand Down
80 changes: 48 additions & 32 deletions packages/prompts/test/__snapshots__/suggestion.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -142,17 +142,21 @@ exports[`text (isCI = false) > renders submitted value 1`] = `

exports[`text (isCI = false) > validation errors render and clear (using Error) 1`] = `
[
"<cursor.hide>",
"<cursor.backward count=999>",
"",
"<erase.down>",
"│
◆ foo
│ xyz
└
▲ foo
│ xyz
└ should be xy
",
"<cursor.backward count=999><cursor.up count=4>",
"<cursor.down count=2>",
"<erase.line><cursor.left count=1>",
"│ xyz",
"<cursor.down count=2>",
"<cursor.down count=1>",
"<erase.down>",
"◆ foo
│ xyz
└
",
"<cursor.backward count=999><cursor.up count=4>",
"<cursor.down count=1>",
"<erase.down>",
Expand Down Expand Up @@ -180,17 +184,21 @@ exports[`text (isCI = false) > validation errors render and clear (using Error)

exports[`text (isCI = false) > validation errors render and clear 1`] = `
[
"<cursor.hide>",
"<cursor.backward count=999>",
"",
"<erase.down>",
"│
◆ foo
│ xyz
└
▲ foo
│ xyz
└ should be xy
",
"<cursor.backward count=999><cursor.up count=4>",
"<cursor.down count=2>",
"<erase.line><cursor.left count=1>",
"│ xyz",
"<cursor.down count=2>",
"<cursor.down count=1>",
"<erase.down>",
"◆ foo
│ xyz
└
",
"<cursor.backward count=999><cursor.up count=4>",
"<cursor.down count=1>",
"<erase.down>",
Expand Down Expand Up @@ -358,17 +366,21 @@ exports[`text (isCI = true) > renders submitted value 1`] = `

exports[`text (isCI = true) > validation errors render and clear (using Error) 1`] = `
[
"<cursor.hide>",
"<cursor.backward count=999>",
"",
"<erase.down>",
"│
◆ foo
│ xyz
└
▲ foo
│ xyz
└ should be xy
",
"<cursor.backward count=999><cursor.up count=4>",
"<cursor.down count=2>",
"<erase.line><cursor.left count=1>",
"│ xyz",
"<cursor.down count=2>",
"<cursor.down count=1>",
"<erase.down>",
"◆ foo
│ xyz
└
",
"<cursor.backward count=999><cursor.up count=4>",
"<cursor.down count=1>",
"<erase.down>",
Expand Down Expand Up @@ -396,17 +408,21 @@ exports[`text (isCI = true) > validation errors render and clear (using Error) 1

exports[`text (isCI = true) > validation errors render and clear 1`] = `
[
"<cursor.hide>",
"<cursor.backward count=999>",
"",
"<erase.down>",
"│
◆ foo
│ xyz
└
▲ foo
│ xyz
└ should be xy
",
"<cursor.backward count=999><cursor.up count=4>",
"<cursor.down count=2>",
"<erase.line><cursor.left count=1>",
"│ xyz",
"<cursor.down count=2>",
"<cursor.down count=1>",
"<erase.down>",
"◆ foo
│ xyz
└
",
"<cursor.backward count=999><cursor.up count=4>",
"<cursor.down count=1>",
"<erase.down>",
Expand Down
Loading