write test script for cypress
to properly kill the process
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
"scripts": {
|
||||
"prepare": "remix setup node",
|
||||
"dev": "concurrently 'typedoc --watch' 'remix dev'",
|
||||
"test": "pnpm build && pnpm start & wait-on http-get://localhost:3000 && cypress run && exit 0",
|
||||
"test": "esmo ./scripts/test.ts",
|
||||
"test-dev": "pnpm dev & wait-on http-get://localhost:3000 && cypress open",
|
||||
"build": "typedoc && remix build",
|
||||
"start": "remix-serve build",
|
||||
@@ -37,6 +37,8 @@
|
||||
"@types/tailwindcss": "^3.0.2",
|
||||
"concurrently": "^7.0.0",
|
||||
"cypress": "^9.2.1",
|
||||
"esno": "^0.13.0",
|
||||
"execa": "^6.0.0",
|
||||
"rehype-prism-plus": "^1.3.0",
|
||||
"typedoc": "^0.22.10",
|
||||
"typescript": "^4.5.4",
|
||||
|
||||
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