Skip to content

Commit

Permalink
fix: test unlimited --lineWidth
Browse files Browse the repository at this point in the history
  • Loading branch information
ddebin committed Nov 21, 2024
1 parent cc8b275 commit 0291d45
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test/test-long-line.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
b:
c:
d: false
b: 35
a: Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam nec volutpat mi, ac consectetur est. Proin venenatis tortor ut erat interdum finibus.
13 changes: 13 additions & 0 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,19 @@ test('CLI --lineWidth', (t) => {
proc.end()
})

test('CLI --lineWidth unlimited', (t) => {
const proc = spawn(t, '../yaml-sort.js --input test-long-line.yml --stdout --lineWidth -1', opts)
proc.exitCode(0)
proc.stdout.match('a: Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam nec volutpat mi, ac consectetur est. Proin venenatis tortor ut erat interdum finibus.\n' +
'b:\n' +
' b: 35\n' +
' c:\n' +
' d: false\n' +
'\n')
proc.stderr.match('')
proc.end()
})

test('CLI --check FAIL', (t) => {
const proc = spawn(t,
'../yaml-sort.js --input test.yml --check', opts)
Expand Down

0 comments on commit 0291d45

Please sign in to comment.