write test script for cypress

to properly kill the process
This commit is contained in:
MapleLeaf
2022-01-10 23:03:29 -06:00
parent b0e937f896
commit d3f6c8af4d
4 changed files with 32 additions and 9 deletions

View 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()