Skip to content

Commit 0028edf

Browse files
committed
Dev environment - Add script to run individual cy tests
1 parent d32d012 commit 0028edf

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,9 @@
8888
"test:w": "vitest --watch",
8989
"test:e2e": "npx cypress open",
9090
"simple-build": "npm run clean && vite build --mode production && node copy-types.cjs",
91-
"preprod": "node del-dev-dep.cjs && npm run clean && vite build --mode production && node copy-types.cjs && node copy-docs.cjs && node post-build.cjs"
91+
"preprod": "node del-dev-dep.cjs && npm run clean && vite build --mode production && node copy-types.cjs && node copy-docs.cjs && node post-build.cjs",
92+
"cy-all": "npx cypress run --component",
93+
"cy": "node run-cy.cjs"
9294
},
9395
"peerDependencies": {
9496
"vue": ">=3.3.0",

run-cy.cjs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
const { execSync } = require("child_process");
2+
3+
const file = process.argv[2];
4+
if (!file) {
5+
console.error("❌ Please provide a test filename, e.g. npm run cy Slicer");
6+
process.exit(1);
7+
}
8+
9+
const cmd = `npx cypress run --component --spec "src/**/${file}.cy.js"`;
10+
console.log("▶️ Running:", cmd);
11+
execSync(cmd, { stdio: "inherit" });

0 commit comments

Comments
 (0)