1
0
Fork 0
mirror of https://github.com/actions/toolkit synced 2025-05-10 09:03:02 +00:00

Add test for large stdline output (#827)

* Add test for large stdline output

* Format/Lint

* Update stdlineoutput.js

* Update stdlineoutput.js
This commit is contained in:
Luke Tomlinson 2021-06-03 09:31:48 -04:00 committed by GitHub
parent c5035362ab
commit 8df94d9879
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 30 additions and 0 deletions

View file

@ -286,6 +286,31 @@ describe('@actions/exec', () => {
expect(stderrCalled).toBeTruthy()
})
it('Handles large stdline', async () => {
const stdlinePath: string = path.join(
__dirname,
'scripts',
'stdlineoutput.js'
)
const nodePath: string = await io.which('node', true)
const _testExecOptions = getExecOptions()
let largeLine = ''
_testExecOptions.listeners = {
stdline: (line: string) => {
largeLine = line
}
}
const exitCode = await exec.exec(
`"${nodePath}"`,
[stdlinePath],
_testExecOptions
)
expect(exitCode).toBe(0)
expect(Buffer.byteLength(largeLine)).toEqual(2 ** 16 + 1)
})
it('Handles stdin shell', async () => {
let command: string
if (IS_WINDOWS) {