test(web-app): add cypress for unit test

This commit is contained in:
fastium
2025-06-08 17:27:08 +02:00
parent 94df7fc910
commit e8fae59467
10 changed files with 2206 additions and 25 deletions

27
web-app/cypress.config.ts Normal file
View File

@@ -0,0 +1,27 @@
import { defineConfig } from "cypress";
export default defineConfig({
e2e: {
specPattern: "tests/e2e/*.spec.ts",
baseUrl: "http://localhost:8080",
supportFile: "tests/support/e2e.ts",
setupNodeEvents(on, config) {
on("before:browser:launch", (browser, launchOptions) => {
// Allow tests to run even if baseUrl is not available
// This is useful for unit tests that don't need a server
if (process.env.CYPRESS_SKIP_SERVER_CHECK === "true") {
config.baseUrl = null;
return config;
}
return launchOptions;
});
},
},
component: {
devServer: {
framework: "vue",
bundler: "webpack",
},
specPattern: "src/**/*.cy.ts",
},
});