Files
online-energieausweis/cypress.config.ts
Moritz Utcke 9acf9e1e50 Tests
2025-03-25 22:42:28 -03:00

49 lines
1.4 KiB
TypeScript

import { defineConfig } from "cypress";
import dsv from "@rollup/plugin-dsv"
import { prisma } from "./src/lib/server/prisma"
import { fileURLToPath } from "url";
import vitePreprocessor from "cypress-vite";
export default defineConfig({
e2e: {
baseUrl: "http://localhost:3000",
viewportHeight: 900,
viewportWidth: 1660,
supportFile: fileURLToPath(new URL("./src/cypress/support/commands.ts", import.meta.url)),
specPattern: "./src/cypress/e2e/**/*.{ts,js}",
setupNodeEvents(on, config) {
on("file:preprocessor", vitePreprocessor({
optimizeDeps: {
exclude: ["@ibcornelsen/database"]
},
resolve: {
alias: {
".prisma/client/index-browser": fileURLToPath(new URL("./node_modules/.prisma/client/index-browser.js", import.meta.url)),
"#": fileURLToPath(new URL("./src", import.meta.url)),
"#components": fileURLToPath(new URL("./src/components", import.meta.url)),
"#lib": fileURLToPath(new URL("./src/lib", import.meta.url))
}
},
base: fileURLToPath(new URL("./src", import.meta.url)),
build: {
commonjsOptions: {
transformMixedEsModules: false
}
},
plugins: [dsv()]
}))
on("task", {
async verbrauchsausweisWohnen(query) {
return await prisma.verbrauchsausweisWohnen.findFirst(query)
}
})
},
},
component: {
devServer: {
framework: "svelte",
bundler: "vite"
},
}
});