File tree Expand file tree Collapse file tree 2 files changed +31
-0
lines changed Expand file tree Collapse file tree 2 files changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,8 @@ const YAML_STYLE: DumpOptions = {
3636 // Either reason about not having 'undefined' in all cases OR
3737 // only skip 'undefined'.
3838 skipInvalid : true ,
39+ // unset lineWidth from default of 80 to avoid reformatting
40+ lineWidth : - 1 ,
3941} ;
4042
4143/**
Original file line number Diff line number Diff line change @@ -466,6 +466,35 @@ results:
466466 severity: error
467467` ) ;
468468 } ) ;
469+
470+ it ( 'preserves long lines' , ( ) => {
471+ const result = stringify (
472+ new Configs ( [
473+ {
474+ apiVersion : 'v1' ,
475+ kind : 'Namespace' ,
476+ metadata : {
477+ name :
478+ '0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789' ,
479+ } ,
480+ } ,
481+ ] ) ,
482+ FileFormat . YAML
483+ ) ;
484+
485+ expect ( result ) . toEqual (
486+ `apiVersion: v1
487+ kind: ResourceList
488+ metadata:
489+ name: output
490+ items:
491+ - apiVersion: v1
492+ kind: Namespace
493+ metadata:
494+ name: 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
495+ `
496+ ) ;
497+ } ) ;
469498 } ) ;
470499
471500 describe ( 'in JSON format' , ( ) => {
You can’t perform that action at this time.
0 commit comments