Skip to content

Commit f2f2be0

Browse files
committed
Edge case test for wrap with trivial input
1 parent 8a50ea7 commit f2f2be0

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

tests/help.wrap.test.js

+8-1
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,20 @@ const commander = require('../');
44
// There is some overlap with the higher level Command tests (which predate Help).
55

66
describe('wrap', () => {
7-
test('when string fits into width then no wrap', () => {
7+
test('when string fits into width then returns input', () => {
88
const text = 'a '.repeat(24) + 'a';
99
const helper = new commander.Help();
1010
const wrapped = helper.wrap(text, 50, 3);
1111
expect(wrapped).toEqual(text);
1212
});
1313

14+
test('when string shorter than indent then returns input', () => {
15+
const text = 'a';
16+
const helper = new commander.Help();
17+
const wrapped = helper.wrap(text, 50, 3);
18+
expect(wrapped).toEqual(text);
19+
});
20+
1421
test('when string exceeds width then wrap', () => {
1522
const text = 'a '.repeat(30) + 'a';
1623
const helper = new commander.Help();

0 commit comments

Comments
 (0)