forked from Klaveness-Digital/cypress-cucumber-preprocessor
-
-
Notifications
You must be signed in to change notification settings - Fork 149
/
cypress.config.ts
33 lines (31 loc) · 1.1 KB
/
cypress.config.ts
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
import { defineConfig } from "cypress";
import { devServer } from "@cypress/vite-dev-server";
import react from "@vitejs/plugin-react";
import { viteCommonjs } from "@originjs/vite-plugin-commonjs";
import { addCucumberPreprocessorPlugin } from "@badeball/cypress-cucumber-preprocessor";
import { createRollupPlugin } from "@badeball/cypress-cucumber-preprocessor/rollup";
export default defineConfig({
component: {
specPattern: "**/*.feature",
devServer(devServerConfig) {
return devServer({
...devServerConfig,
framework: "react",
bundler: "vite",
viteConfig: {
plugins: [
react(),
createRollupPlugin(devServerConfig.cypressConfig),
viteCommonjs(),
],
},
});
},
async setupNodeEvents(on, config) {
// This is required for the preprocessor to be able to generate JSON reports after each run, and more.
await addCucumberPreprocessorPlugin(on, config);
// Make sure to return the config object as it might have been modified by the plugin.
return config;
},
},
});