Skip to content
Merged
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
192 changes: 91 additions & 101 deletions command/test/integration/__snapshots__/test.ts.snap

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions prompt/test/integration/__snapshots__/checkbox_test.ts.snap
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
export const snapshot = {};

snapshot[`checkbox prompt > should check an option 1`] = `
"stdout:
? Select an option
stdout:
"? Select an option
❯ ✘ Foo
✘ Bar
✘ Baz\\x1b[3A\\x1b[19G\\x1b[?25l\\x1b[G\\x1b[0J
Expand All @@ -19,7 +19,7 @@ snapshot[`checkbox prompt > should check an option 1`] = `
✘ Bar
❯ ✔ Baz\\x1b[3A\\x1b[19G\\x1b[?25l\\x1b[G\\x1b[0J
? Select an option › Baz
\\x1b[?25h\\x1b[?25h
\\x1b[?25h\\x1b[?25h"
stderr:
"
""
`;
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
export const snapshot = {};

snapshot[`checkbox prompt > should check an option 1`] = `
"stdout:
? Select an option
stdout:
"? Select an option
❯ × Foo
× Bar
× Baz\\x1b[3A\\x1b[19G\\x1b[?25l\\x1b[G\\x1b[0J
Expand All @@ -19,7 +19,7 @@ snapshot[`checkbox prompt > should check an option 1`] = `
× Bar
❯ √ Baz\\x1b[3A\\x1b[19G\\x1b[?25l\\x1b[G\\x1b[0J
? Select an option » Baz
\\x1b[?25h\\x1b[?25h
\\x1b[?25h\\x1b[?25h"
stderr:
"
""
`;
24 changes: 12 additions & 12 deletions prompt/test/integration/__snapshots__/confirm_test.ts.snap
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
export const snapshot = {};

snapshot[`confirm prompt > should confirm 1`] = `
"stdout:
? Please confirm (y/N) ›
stdout:
"? Please confirm (y/N) ›
❯ some hint\\x1b[1A\\x1b[26G\\x1b[G\\x1b[0J
? Please confirm (y/N) › yes
❯ some hint\\x1b[1A\\x1b[27G\\x1b[G\\x1b[0J
? Please confirm (y/N) › Yes
\\x1b[?25h\\x1b[?25h
\\x1b[?25h\\x1b[?25h"
stderr:
"
""
`;

snapshot[`confirm prompt > should not confirm 1`] = `
"stdout:
? Please confirm (y/N) ›
stdout:
"? Please confirm (y/N) ›
❯ some hint\\x1b[1A\\x1b[26G\\x1b[G\\x1b[0J
? Please confirm (y/N) › no
❯ some hint\\x1b[1A\\x1b[27G\\x1b[G\\x1b[0J
? Please confirm (y/N) › No
\\x1b[?25h\\x1b[?25h
\\x1b[?25h\\x1b[?25h"
stderr:
"
""
`;

snapshot[`confirm prompt > should not confirm by default 1`] = `
"stdout:
? Please confirm (y/N) ›
stdout:
"? Please confirm (y/N) ›
❯ some hint\\x1b[1A\\x1b[26G\\x1b[G\\x1b[0J
? Please confirm (y/N) › No
\\x1b[?25h\\x1b[?25h
\\x1b[?25h\\x1b[?25h"
stderr:
"
""
`;
24 changes: 12 additions & 12 deletions prompt/test/integration/__snapshots__/confirm_test.ts.windows.snap
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
export const snapshot = {};

snapshot[`confirm prompt > should confirm 1`] = `
"stdout:
? Please confirm (y/N) »
stdout:
"? Please confirm (y/N) »
❯ some hint\\x1b[1A\\x1b[26G\\x1b[G\\x1b[0J
? Please confirm (y/N) » yes
❯ some hint\\x1b[1A\\x1b[27G\\x1b[G\\x1b[0J
? Please confirm (y/N) » Yes
\\x1b[?25h\\x1b[?25h
\\x1b[?25h\\x1b[?25h"
stderr:
"
""
`;

snapshot[`confirm prompt > should not confirm 1`] = `
"stdout:
? Please confirm (y/N) »
stdout:
"? Please confirm (y/N) »
❯ some hint\\x1b[1A\\x1b[26G\\x1b[G\\x1b[0J
? Please confirm (y/N) » no
❯ some hint\\x1b[1A\\x1b[27G\\x1b[G\\x1b[0J
? Please confirm (y/N) » No
\\x1b[?25h\\x1b[?25h
\\x1b[?25h\\x1b[?25h"
stderr:
"
""
`;

snapshot[`confirm prompt > should not confirm by default 1`] = `
"stdout:
? Please confirm (y/N) »
stdout:
"? Please confirm (y/N) »
❯ some hint\\x1b[1A\\x1b[26G\\x1b[G\\x1b[0J
? Please confirm (y/N) » No
\\x1b[?25h\\x1b[?25h
\\x1b[?25h\\x1b[?25h"
stderr:
"
""
`;
46 changes: 23 additions & 23 deletions prompt/test/integration/__snapshots__/input_test.ts.snap
Original file line number Diff line number Diff line change
@@ -1,65 +1,65 @@
export const snapshot = {};

snapshot[`input prompt > should enter some text 1`] = `
"stdout:
? Whats your name? (foo) › \\x1b[28G\\x1b[G\\x1b[0J
stdout:
"? Whats your name? (foo) › \\x1b[28G\\x1b[G\\x1b[0J
? Whats your name? (foo) › foo bar\\x1b[35G\\x1b[G\\x1b[0J
? Whats your name? (foo) › foo bar
\\x1b[?25h\\x1b[?25h
\\x1b[?25h\\x1b[?25h"
stderr:
"
""
`;

snapshot[`input prompt with suggestions > should enable suggestions and list 1`] = `
"stdout:
? Whats your name? (foo) ›
stdout:
"? Whats your name? (foo) ›
foo
bar
baz\\x1b[3A\\x1b[28G\\x1b[G\\x1b[0J
? Whats your name? (foo) › foo
❯ foo\\x1b[1A\\x1b[31G\\x1b[G\\x1b[0J
? Whats your name? (foo) › foo
\\x1b[?25h\\x1b[?25h
\\x1b[?25h\\x1b[?25h"
stderr:
"
""
`;

snapshot[`input prompt with prefix > should change prefix 1`] = `
"stdout:
PREFIX Whats your name? (foo) › \\x1b[33G\\x1b[G\\x1b[0J
stdout:
"PREFIX Whats your name? (foo) › \\x1b[33G\\x1b[G\\x1b[0J
PREFIX Whats your name? (foo) › bar\\x1b[36G\\x1b[G\\x1b[0J
PREFIX Whats your name? (foo) › bar
\\x1b[?25h\\x1b[?25h
\\x1b[?25h\\x1b[?25h"
stderr:
"
""
`;

snapshot[`input prompt with writer set to stderr > should enter some text 1`] = `
"stdout:

stdout:
""
stderr:
? Whats your name? (foo) › \\x1b[28G\\x1b[G\\x1b[0J
"? Whats your name? (foo) › \\x1b[28G\\x1b[G\\x1b[0J
? Whats your name? (foo) › foo bar\\x1b[35G\\x1b[G\\x1b[0J
? Whats your name? (foo) › foo bar
\\x1b[?25h\\x1b[?25h"
`;

snapshot[`input prompt without prefix > should disable prefix 1`] = `
"stdout:
Whats your name? (foo) › \\x1b[26G\\x1b[G\\x1b[0J
stdout:
"Whats your name? (foo) › \\x1b[26G\\x1b[G\\x1b[0J
Whats your name? (foo) › bar\\x1b[29G\\x1b[G\\x1b[0J
Whats your name? (foo) › bar
\\x1b[?25h\\x1b[?25h
\\x1b[?25h\\x1b[?25h"
stderr:
"
""
`;

snapshot[`input prompt with no location flag > should work without --location flag 1`] = `
"stdout:
? Works without --location? (hope so) › \\x1b[41G\\x1b[G\\x1b[0J
stdout:
"? Works without --location? (hope so) › \\x1b[41G\\x1b[G\\x1b[0J
? Works without --location? (hope so) › yes\\x1b[44G\\x1b[G\\x1b[0J
? Works without --location? (hope so) › yes
\\x1b[?25h\\x1b[?25h
\\x1b[?25h\\x1b[?25h"
stderr:
"
""
`;
46 changes: 23 additions & 23 deletions prompt/test/integration/__snapshots__/input_test.ts.windows.snap
Original file line number Diff line number Diff line change
@@ -1,65 +1,65 @@
export const snapshot = {};

snapshot[`input prompt > should enter some text 1`] = `
"stdout:
? Whats your name? (foo) » \\x1b[28G\\x1b[G\\x1b[0J
stdout:
"? Whats your name? (foo) » \\x1b[28G\\x1b[G\\x1b[0J
? Whats your name? (foo) » foo bar\\x1b[35G\\x1b[G\\x1b[0J
? Whats your name? (foo) » foo bar
\\x1b[?25h\\x1b[?25h
\\x1b[?25h\\x1b[?25h"
stderr:
"
""
`;

snapshot[`input prompt with suggestions > should enable suggestions and list 1`] = `
"stdout:
? Whats your name? (foo) »
stdout:
"? Whats your name? (foo) »
foo
bar
baz\\x1b[3A\\x1b[28G\\x1b[G\\x1b[0J
? Whats your name? (foo) » foo
❯ foo\\x1b[1A\\x1b[31G\\x1b[G\\x1b[0J
? Whats your name? (foo) » foo
\\x1b[?25h\\x1b[?25h
\\x1b[?25h\\x1b[?25h"
stderr:
"
""
`;

snapshot[`input prompt with prefix > should change prefix 1`] = `
"stdout:
PREFIX Whats your name? (foo) » \\x1b[33G\\x1b[G\\x1b[0J
stdout:
"PREFIX Whats your name? (foo) » \\x1b[33G\\x1b[G\\x1b[0J
PREFIX Whats your name? (foo) » bar\\x1b[36G\\x1b[G\\x1b[0J
PREFIX Whats your name? (foo) » bar
\\x1b[?25h\\x1b[?25h
\\x1b[?25h\\x1b[?25h"
stderr:
"
""
`;

snapshot[`input prompt with writer set to stderr > should enter some text 1`] = `
"stdout:

stdout:
""
stderr:
? Whats your name? (foo) » \\x1b[28G\\x1b[G\\x1b[0J
"? Whats your name? (foo) » \\x1b[28G\\x1b[G\\x1b[0J
? Whats your name? (foo) » foo bar\\x1b[35G\\x1b[G\\x1b[0J
? Whats your name? (foo) » foo bar
\\x1b[?25h\\x1b[?25h"
`;

snapshot[`input prompt without prefix > should disable prefix 1`] = `
"stdout:
Whats your name? (foo) » \\x1b[26G\\x1b[G\\x1b[0J
stdout:
"Whats your name? (foo) » \\x1b[26G\\x1b[G\\x1b[0J
Whats your name? (foo) » bar\\x1b[29G\\x1b[G\\x1b[0J
Whats your name? (foo) » bar
\\x1b[?25h\\x1b[?25h
\\x1b[?25h\\x1b[?25h"
stderr:
"
""
`;

snapshot[`input prompt with no location flag > should work without --location flag 1`] = `
"stdout:
? Works without --location? (hope so) » \\x1b[41G\\x1b[G\\x1b[0J
stdout:
"? Works without --location? (hope so) » \\x1b[41G\\x1b[G\\x1b[0J
? Works without --location? (hope so) » yes\\x1b[44G\\x1b[G\\x1b[0J
? Works without --location? (hope so) » yes
\\x1b[?25h\\x1b[?25h
\\x1b[?25h\\x1b[?25h"
stderr:
"
""
`;
8 changes: 4 additions & 4 deletions prompt/test/integration/__snapshots__/list_test.ts.snap
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
export const snapshot = {};

snapshot[`list prompt > should enter some keywords 1`] = `
"stdout:
? Enter some keywords (foo, far) ›
stdout:
"? Enter some keywords (foo, far) ›
❯ some hint...\\x1b[1A\\x1b[36G\\x1b[G\\x1b[0J
? Enter some keywords (foo, far) › foo, bar
❯ some hint...\\x1b[1A\\x1b[44G\\x1b[G\\x1b[0J
? Enter some keywords (foo, far) › foo, bar
\\x1b[?25h\\x1b[?25h
\\x1b[?25h\\x1b[?25h"
stderr:
"
""
`;
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
export const snapshot = {};

snapshot[`list prompt > should enter some keywords 1`] = `
"stdout:
? Enter some keywords (foo, far) »
stdout:
"? Enter some keywords (foo, far) »
❯ some hint...\\x1b[1A\\x1b[36G\\x1b[G\\x1b[0J
? Enter some keywords (foo, far) » foo, bar
❯ some hint...\\x1b[1A\\x1b[44G\\x1b[G\\x1b[0J
? Enter some keywords (foo, far) » foo, bar
\\x1b[?25h\\x1b[?25h
\\x1b[?25h\\x1b[?25h"
stderr:
"
""
`;
16 changes: 8 additions & 8 deletions prompt/test/integration/__snapshots__/number_test.ts.snap
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
export const snapshot = {};

snapshot[`number prompt > should enter a number 1`] = `
"stdout:
? How old are you? (7) › \\x1b[26G\\x1b[G\\x1b[0J
stdout:
"? How old are you? (7) › \\x1b[26G\\x1b[G\\x1b[0J
? How old are you? (7) › 19\\x1b[28G\\x1b[G\\x1b[0J
? How old are you? (7) › 20\\x1b[27G\\x1b[G\\x1b[0J
? How old are you? (7) › 21\\x1b[27G\\x1b[G\\x1b[0J
Expand All @@ -14,21 +14,21 @@ snapshot[`number prompt > should enter a number 1`] = `
? How old are you? (7) › 19\\x1b[27G\\x1b[G\\x1b[0J
? How old are you? (7) › 20\\x1b[27G\\x1b[G\\x1b[0J
? How old are you? (7) › 20
\\x1b[?25h\\x1b[?25h
\\x1b[?25h\\x1b[?25h"
stderr:
"
""
`;

snapshot[`number prompt with float > should enter a floating number 1`] = `
"stdout:
? How old are you? (7) › \\x1b[26G\\x1b[G\\x1b[0J
stdout:
"? How old are you? (7) › \\x1b[26G\\x1b[G\\x1b[0J
? How old are you? (7) › 19.\\x1b[29G\\x1b[G\\x1b[0J
? How old are you? (7) › 19.1\\x1b[29G\\x1b[G\\x1b[0J
? How old are you? (7) › 19.2\\x1b[29G\\x1b[G\\x1b[0J
? How old are you? (7) › 19.3\\x1b[29G\\x1b[G\\x1b[0J
? How old are you? (7) › 19.4\\x1b[29G\\x1b[G\\x1b[0J
? How old are you? (7) › 19.4
\\x1b[?25h\\x1b[?25h
\\x1b[?25h\\x1b[?25h"
stderr:
"
""
`;
Loading