Skip to content

Commit

Permalink
test: Add tests for --pretty CLI option
Browse files Browse the repository at this point in the history
  • Loading branch information
danielbayley committed Jun 30, 2024
1 parent fa3f5b1 commit f7fb67f
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions tests/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,26 @@ const skip = Number(major) < 20
['[{"hello":"world"},42]']
)
})
describe('--pretty', () => {
ok(
'basic',
'hello: world',
['--json', '--pretty'],
['[\n {\n "hello": "world"\n }\n]']
)
ok(
'--single',
'hello: world',
['--json', '--pretty', '--single'],
['{\n "hello": "world"\n}']
)
ok(
'multiple',
'hello: world\n---\n42',
['--json', '--pretty'],
['[\n {\n "hello": "world"\n },\n 42\n]']
)
})
describe('--doc', () => {
ok('basic', 'hello: world', ['--doc'], [{ contents: { items: [{}] } }])
ok(
Expand Down

0 comments on commit f7fb67f

Please sign in to comment.