Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/lib/functions/local-proxy.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
const { stdout } = require('process')

const { getBinaryPath: getFunctionsProxyPath } = require('@netlify/local-functions-proxy')

const execa = require('../../utils/execa')
Expand Down Expand Up @@ -34,8 +36,11 @@ const runFunctionsProxy = ({ binaryPath, context, directory, event, name, timeou
'--timeout',
`${timeout}s`,
]
const proxyProcess = execa(functionsProxyPath, parameters)

proxyProcess.stderr.pipe(stdout)
Comment thread
eduardoboucas marked this conversation as resolved.

return execa(functionsProxyPath, parameters)
return proxyProcess
}

module.exports = { runFunctionsProxy }
7 changes: 6 additions & 1 deletion tests/serving-functions-go.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ test('Updates a Go function when a file is modified', async (t) => {

let proxyCallCount = 0

module.exports = async (...args) => {
const handler = (...args) => {
if (args[0] === 'go') {
const binaryPath = args[1][2]

Expand All @@ -45,6 +45,11 @@ test('Updates a Go function when a file is modified', async (t) => {
}
}
}

module.exports = (...args) => ({
...handler(...args) || {},
stderr: { pipe: () => {} }
})
`)

await withSiteBuilder('go-function-update', async (builder) => {
Expand Down
7 changes: 6 additions & 1 deletion tests/serving-functions-rust.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ test('Updates a Rust function when a file is modified', async (t) => {
const [execaMock, removeExecaMock] = await createExecaMock(`
let proxyCallCount = 0

module.exports = async (...args) => {
const handler = (...args) => {
if (args[0] === 'cargo') {
return {
stderr: '',
Expand All @@ -61,6 +61,11 @@ test('Updates a Rust function when a file is modified', async (t) => {
}
}
}

module.exports = (...args) => ({
...handler(...args) || {},
stderr: { pipe: () => {} }
})
`)

await withDevServer(
Expand Down