-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcypress.config.ts
51 lines (46 loc) · 1.31 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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/* eslint-disable @typescript-eslint/no-var-requires */
import { defineConfig } from "cypress";
import ReactDocgenTypescriptPlugin from "react-docgen-typescript-plugin";
import * as tasks from "./cypress/support/tasks";
import {
cypressWebpackConfigMdx,
setStorybookFiles,
useIsolatedComponentFiles,
} from "./src";
// @ts-ignore
import webpackConfigDev from "./webpack.config";
const webpackConfig = cypressWebpackConfigMdx(webpackConfigDev);
webpackConfig.plugins.push(new ReactDocgenTypescriptPlugin());
webpackConfig.module.rules.push({
test: /\.css$/i,
use: ["style-loader", "css-loader"],
});
export default defineConfig({
videoUploadOnPasses: false,
component: {
env: {
"orphic-cypress": {
storyLocation: "./stories/",
},
},
devServer: {
framework: "react",
bundler: "webpack",
webpackConfig,
},
...(useIsolatedComponentFiles && {
specPattern: [
"**/*.stories.ts{,x}",
"**/*.cy.ts{,x}",
"**/*.stories.mdx",
],
excludeSpecPattern: ["**/*/mount.cy.ts{,x}", "**/*/Overview.*"],
}),
setupNodeEvents: (on, config) => {
require("@bahmutov/cypress-code-coverage/plugin")(on, config);
on("task", tasks);
return setStorybookFiles(on, config);
},
experimentalSingleTabRunMode: true,
},
});