-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcypress.config.ts
More file actions
57 lines (53 loc) · 1.53 KB
/
cypress.config.ts
File metadata and controls
57 lines (53 loc) · 1.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
import { defineConfig } from "cypress"
import vitePreprocessor from "cypress-vite"
import fs from "fs"
export default defineConfig({
// component: {
// devServer: {
// framework: "vue",
// bundler: "vite"
// },
// specPattern: 'src/components/**/*.cy.ts',
//
// component: {
// // Other configurations...
// experimentalJustInTimeCompile: true,
// },
//
// setupNodeEvents(on, config) {
// on("task", {
// // ref: https://docs.cypress.io/api/commands/task#Read-a-file-that-might-not-exist
// readFileMaybe(filename: string) {
// if (fs.existsSync(filename)) {
// return fs.readFileSync(filename, "utf8")
// }
//
// return null
// }
// })
// }
// },
e2e: {
baseUrl: "http://localhost:5173",
specPattern: "src/components/**/*.spec.ts",
experimentalRunAllSpecs: true,
setupNodeEvents(on, config) {
// todo: get vite to launch if not already running
// on("before:run", () => {
// const viteProcess = spawn("npm", ["run", "dev"], { stdio: "inherit" })
//
// // Wait for the Vite server to start
// return new Promise((resolve) => {
// viteProcess.stdout.on("data", (data) => {
// if (data.toString().includes("Vite v")) {
// resolve()
// }
// })
// }).then(() => {
// console.log("Vite server started")
// })
// })
on("file:preprocessor", vitePreprocessor())
}
}
})