1
0
Fork 0

fix Buffer deprecation warnings (#265)

pull/269/head
eric sciple 2019-12-18 13:24:01 -05:00 committed by GitHub
parent 568f12cee6
commit 81bdf00982
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 7 deletions

View File

@ -53,7 +53,7 @@ describe('@actions/exec', () => {
expect(outstream.write).toBeCalledWith( expect(outstream.write).toBeCalledWith(
`[command]${toolpath} /c echo hello${os.EOL}` `[command]${toolpath} /c echo hello${os.EOL}`
) )
expect(outstream.write).toBeCalledWith(new Buffer(`hello${os.EOL}`)) expect(outstream.write).toBeCalledWith(Buffer.from(`hello${os.EOL}`))
} else { } else {
expect(outstream.write).toBeCalledWith( expect(outstream.write).toBeCalledWith(
`[command]${toolpath} -l -a${os.EOL}` `[command]${toolpath} -l -a${os.EOL}`
@ -83,7 +83,7 @@ describe('@actions/exec', () => {
expect(outstream.write).toBeCalledWith( expect(outstream.write).toBeCalledWith(
`[command]${toolpath} /c echo hello${os.EOL}` `[command]${toolpath} /c echo hello${os.EOL}`
) )
expect(outstream.write).toBeCalledWith(new Buffer(`hello${os.EOL}`)) expect(outstream.write).toBeCalledWith(Buffer.from(`hello${os.EOL}`))
} else { } else {
expect(outstream.write).toBeCalledWith( expect(outstream.write).toBeCalledWith(
`[command]${toolpath} -l -a${os.EOL}` `[command]${toolpath} -l -a${os.EOL}`
@ -113,7 +113,7 @@ describe('@actions/exec', () => {
expect(outstream.write).toBeCalledWith( expect(outstream.write).toBeCalledWith(
`[command]${toolpath} /c echo hello${os.EOL}` `[command]${toolpath} /c echo hello${os.EOL}`
) )
expect(outstream.write).toBeCalledWith(new Buffer(`hello${os.EOL}`)) expect(outstream.write).toBeCalledWith(Buffer.from(`hello${os.EOL}`))
} else { } else {
expect(outstream.write).toBeCalledWith( expect(outstream.write).toBeCalledWith(
`[command]${toolpath} -l -a${os.EOL}` `[command]${toolpath} -l -a${os.EOL}`
@ -205,7 +205,7 @@ describe('@actions/exec', () => {
expect(exitCode).toBe(0) expect(exitCode).toBe(0)
expect(outstream.write).toBeCalledWith( expect(outstream.write).toBeCalledWith(
new Buffer('this is output to stderr') Buffer.from('this is output to stderr')
) )
}) })
@ -229,7 +229,7 @@ describe('@actions/exec', () => {
expect(failed).toBe(true) expect(failed).toBe(true)
expect(errstream.write).toBeCalledWith( expect(errstream.write).toBeCalledWith(
new Buffer('this is output to stderr') Buffer.from('this is output to stderr')
) )
}) })
@ -264,11 +264,11 @@ describe('@actions/exec', () => {
const _testExecOptions = getExecOptions() const _testExecOptions = getExecOptions()
_testExecOptions.listeners = { _testExecOptions.listeners = {
stdout: (data: Buffer) => { stdout: (data: Buffer) => {
expect(data).toEqual(new Buffer('this is output to stdout')) expect(data).toEqual(Buffer.from('this is output to stdout'))
stdoutCalled = true stdoutCalled = true
}, },
stderr: (data: Buffer) => { stderr: (data: Buffer) => {
expect(data).toEqual(new Buffer('this is output to stderr')) expect(data).toEqual(Buffer.from('this is output to stderr'))
stderrCalled = true stderrCalled = true
} }
} }