Skip to content

Commit

Permalink
test: use child_process instead of execa
Browse files Browse the repository at this point in the history
  • Loading branch information
BobbieGoede committed May 16, 2024
1 parent f8ec1be commit fec72eb
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 565 deletions.
8 changes: 4 additions & 4 deletions e2e/setup-server.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import execa, { ExecaChildProcess } from 'execa'
import { getRandomPort, waitForPort } from 'get-port-please'
import { ChildProcess, spawn } from 'child_process'

export type ServerContext = {
serverProcess: ExecaChildProcess
serverProcess: ChildProcess
url: (val: string) => string
}
export async function startServer(): Promise<ServerContext> {
const host = '127.0.0.1'
const port = await getRandomPort(host)

// console.log('building...')
// await execa('pnpm', ['--filter=example', 'build'], {
// await spawn('pnpm', ['--filter=example', 'build'], {
// stdio: 'inherit',
// env: {
// ...process.env,
Expand All @@ -21,7 +21,7 @@ export async function startServer(): Promise<ServerContext> {
// })
// console.log('build finished!')

const serverProcess = execa(
const serverProcess = spawn(
'pnpm',
['--filter=example', 'dev', '--port', String(port), '--host', host],
{ stdio: 'inherit', env: { ...process.env } }
Expand Down
3 changes: 0 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,13 @@
"@vue/runtime-dom": "^3.2.45",
"@vue/server-renderer": "^3.2.45",
"api-docs-gen": "^0.4.0",
"babel-loader": "^8.2.0",
"esbuild-register": "^3.5.0",
"eslint": "^8.30.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-prettier": "^4.2.1",
"execa": "^5.1.1",
"get-port-please": "^3.1.2",
"jsdom": "^24.0.0",
"lint-staged": "^11.0.0",
"listhen": "^1.7.2",
"npm-run-all2": "^5.0.0",
"opener": "^1.5.2",
"playwright": "^1.44.0",
Expand Down
Loading

0 comments on commit fec72eb

Please sign in to comment.