Skip to content

Commit d62e1ed

Browse files
committed
update tests
1 parent 1cfe608 commit d62e1ed

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

packages/prompts/test/note.test.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ describe.each(['true', 'false'])('note (isCI = %s)', (isCI) => {
6666

6767
test("don't overflow", () => {
6868
const message = `${'test string '.repeat(32)}\n`.repeat(4).trim();
69+
output.columns = 75;
6970
prompts.note(message, 'title', {
7071
input,
7172
output,
@@ -76,6 +77,7 @@ describe.each(['true', 'false'])('note (isCI = %s)', (isCI) => {
7677

7778
test("don't overflow with formatter", () => {
7879
const message = `${'test string '.repeat(32)}\n`.repeat(4).trim();
80+
output.columns = 75;
7981
prompts.note(message, 'title', {
8082
format: (line) => colors.red(`* ${colors.cyan(line)} *`),
8183
input,
@@ -90,9 +92,10 @@ describe.each(['true', 'false'])('note (isCI = %s)', (isCI) => {
9092
'이게 첫 번째 줄이에요',
9193
'これは次の行です',
9294
];
95+
output.columns = 10;
9396
prompts.note(messages.join("\n"), '这是标题', {
9497
input,
95-
output: Object.assign(output, { columns: 10 }),
98+
output,
9699
});
97100

98101
expect(output.buffer).toMatchSnapshot();
@@ -103,10 +106,11 @@ describe.each(['true', 'false'])('note (isCI = %s)', (isCI) => {
103106
'이게 첫 번째 줄이에요',
104107
'これは次の行です',
105108
];
109+
output.columns = 10;
106110
prompts.note(messages.join("\n"), '这是标题', {
107111
format: (line) => colors.red(`* ${colors.cyan(line)} *`),
108112
input,
109-
output: Object.assign(output, { columns: 10 }),
113+
output,
110114
});
111115

112116
expect(output.buffer).toMatchSnapshot();

0 commit comments

Comments
 (0)