Files
mlb-gameday-dotnet-react/app/cypress.config.ts
2023-01-24 20:03:13 -06:00

70 lines
2.0 KiB
TypeScript

import { defineConfig } from 'cypress';
export default defineConfig({
e2e: {
setupNodeEvents(on, config) {
// return Object.assign({}, config, require('@bahmutov/cypress-code-coverage/plugin')(on, config));
require('@bahmutov/cypress-code-coverage/plugin')(on, config);
return config;
},
// baseUrl: 'http://localhost:3000',
// specPattern: 'cypress/e2e/**/*.{js,jsx,ts,tsx}'
},
component: {
devServer: {
framework: "react",
bundler: "webpack",
// here are the additional settings from Gleb's instructions
webpackConfig: {
mode: "development",
devtool: false,
module: {
rules: [
// application and Cypress files are bundled like React components
// and instrumented using the babel-plugin-istanbul
{
test: /\.(ts|js)x?$/,
exclude: /node_modules/,
resolve: {
extensions: ['.ts', '.tsx', '.js', '.json'],
},
use: {
loader: "babel-loader",
options: {
presets: [
"@babel/preset-env",
"@babel/preset-react",
'@babel/preset-typescript'
],
plugins: [
[
"@babel/plugin-transform-runtime",
{
"regenerator": true
},
],
"istanbul"
],
},
},
},
{
test: /\.(s(a|c)ss)$/,
use: ['css-loader', 'sass-loader'],
}
],
},
},
},
setupNodeEvents(on, config) {
// return Object.assign({}, config, require('@bahmutov/cypress-code-coverage/plugin')(on, config))
require('@bahmutov/cypress-code-coverage/plugin')(on, config)
return config
},
specPattern: 'src/**/**/*.cy.{js,jsx,ts,tsx}'
},
});