write test script for cypress
to properly kill the process
This commit is contained in:
3
packages/docs/scripts/package.json
Normal file
3
packages/docs/scripts/package.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"type": "module"
|
||||
}
|
||||
9
packages/docs/scripts/test.ts
Normal file
9
packages/docs/scripts/test.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import cypress from "cypress"
|
||||
import { execa } from "execa"
|
||||
import waitOn from "wait-on"
|
||||
|
||||
await execa("pnpm", ["build"], { stdio: "inherit" })
|
||||
const app = execa("pnpm", ["start"], { stdio: "inherit" })
|
||||
await waitOn({ resources: ["http-get://localhost:3000"] })
|
||||
await cypress.run()
|
||||
app.kill()
|
||||
Reference in New Issue
Block a user