File tree 1 file changed +8
-1
lines changed
1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -4,13 +4,20 @@ const commander = require('../');
4
4
// There is some overlap with the higher level Command tests (which predate Help).
5
5
6
6
describe ( 'wrap' , ( ) => {
7
- test ( 'when string fits into width then no wrap ' , ( ) => {
7
+ test ( 'when string fits into width then returns input ' , ( ) => {
8
8
const text = 'a ' . repeat ( 24 ) + 'a' ;
9
9
const helper = new commander . Help ( ) ;
10
10
const wrapped = helper . wrap ( text , 50 , 3 ) ;
11
11
expect ( wrapped ) . toEqual ( text ) ;
12
12
} ) ;
13
13
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
+
14
21
test ( 'when string exceeds width then wrap' , ( ) => {
15
22
const text = 'a ' . repeat ( 30 ) + 'a' ;
16
23
const helper = new commander . Help ( ) ;
You can’t perform that action at this time.
0 commit comments