Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add --stdin flag #296

Merged
merged 10 commits into from
Jul 2, 2023
Merged
6 changes: 6 additions & 0 deletions tests/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -494,3 +494,9 @@ test('run `cli --stdin` with input from stdin', macro.testCLI, {
message: 'Should output sorted json',
stdin: `{\n "description": "Description",\n "name": "Name"\n}\n`,
danielpza marked this conversation as resolved.
Show resolved Hide resolved
})

test('run `cli --stdin` with input from stdin with \\r\\n', macro.testCLI, {
args: ['--stdin'],
message: 'The line feed should be CRLF in output',
stdin: `{\n "description": "Description",\n "name": "Name"\n}\r\n`,
danielpza marked this conversation as resolved.
Show resolved Hide resolved
})
20 changes: 20 additions & 0 deletions tests/snapshots/cli.js.md
Original file line number Diff line number Diff line change
Expand Up @@ -1389,3 +1389,23 @@ Generated by [AVA](https://avajs.dev).
`,
},
}

## run `cli --stdin` with input from stdin with \r\n

> The line feed should be CRLF in output

{
args: [
'--stdin',
],
fixtures: [],
result: {
errorCode: null,
stderr: '',
stdout: `{␊
"name": "Name",␊
"description": "Description"␊
}␊
`,
},
}
Binary file modified tests/snapshots/cli.js.snap
Binary file not shown.