Skip to content

Commit 89ec94a

Browse files
authored
dependency-upgrade (#265)
* cypress 9 * react-scripts 5 * react 17
1 parent 1b68393 commit 89ec94a

35 files changed

+23746
-39472
lines changed

cypress.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@
55
"screenshotOnRunFailure": false,
66
"retries": 0,
77
"componentFolder": "src",
8-
"testFiles": "**/*.spec.*"
8+
"testFiles": "**/*.spec.*",
9+
"fixturesFolder": false
910
}

cypress/plugins/index.js

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,40 @@
1+
const { startDevServer } = require("@cypress/webpack-dev-server");
2+
const findReactScriptsWebpackConfig = require("@cypress/react/plugins/react-scripts/findReactScriptsWebpackConfig");
13
const {
24
addVisualRegressionTrackerPlugin,
35
} = require("@visual-regression-tracker/agent-cypress/dist/plugin");
4-
const injectReactScriptsDevServer = require("@cypress/react/plugins/react-scripts");
56

6-
module.exports = async (on, config) => {
7-
injectReactScriptsDevServer(on, config);
7+
/**
8+
* @type {Cypress.PluginConfig}
9+
*/
10+
module.exports = (on, config) => {
11+
const webpackConfig = findReactScriptsWebpackConfig(config);
12+
13+
webpackConfig.resolve.fallback = {
14+
fs: false,
15+
};
16+
17+
// react component tests
18+
on("dev-server:start", async (options) => {
19+
return startDevServer({
20+
options,
21+
webpackConfig,
22+
});
23+
});
24+
config.env.reactDevtools = true;
25+
26+
// visual testing
827
addVisualRegressionTrackerPlugin(on, config);
28+
on("before:browser:launch", (browser, launchOptions) => {
29+
if (browser.name === "chrome" && browser.isHeadless) {
30+
launchOptions.args.push(
31+
`--window-size=${config.viewportWidth},${config.viewportHeight}`
32+
);
33+
return launchOptions;
34+
}
35+
});
36+
37+
// IMPORTANT to return the config object
38+
// with the any changed environment variables
939
return config;
1040
};

0 commit comments

Comments
 (0)