Unverified Commit 178f45b2 authored by JJ Kasper's avatar JJ Kasper Committed by GitHub

Test child_process with API route (#10872)

parent 764edc51
import { execSync } from 'child_process'
export default (req, res) => {
const output = execSync('echo "hi"')
.toString()
.trim()
res.end(output)
}
......@@ -322,6 +322,11 @@ function runTests(dev = false) {
expect(data).toEqual({ post: 'post-1', id: '1' })
})
it('should work with child_process correctly', async () => {
const data = await renderViaHTTP(appPort, '/api/child-process')
expect(data).toBe('hi')
})
if (dev) {
it('should compile only server code in development', async () => {
await fetchViaHTTP(appPort, '/')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment