File tree Expand file tree Collapse file tree 4 files changed +27
-11
lines changed
Expand file tree Collapse file tree 4 files changed +27
-11
lines changed Original file line number Diff line number Diff line change 11import { defineConfig } from 'cypress' ;
22
33export default defineConfig ( {
4+ // Add this to ensure proper ES module handling
5+ experimentalWebKitSupport : true ,
6+ experimentalMemoryManagement : true ,
47 component : {
58 devServer : {
69 framework : 'react' ,
Original file line number Diff line number Diff line change 1+ import MainPage from '../../src/components/MainPage' ;
2+
13describe ( 'MainPage Component' , ( ) => {
24 const testUsername = 'testuser123' ;
35
Original file line number Diff line number Diff line change 11import { mount } from 'cypress/react18' ;
22import '../../src/index.css' ;
33
4- // Augment the Cypress namespace to include type definitions for
5- // your custom command.
6- declare global {
7- namespace Cypress {
8- interface Chainable {
9- mount : typeof mount ;
4+ // Add proper ES module exports
5+ export const setupMount = ( ) => {
6+ // Augment the Cypress namespace to include type definitions for
7+ // your custom command.
8+ declare global {
9+ namespace Cypress {
10+ interface Chainable {
11+ mount : typeof mount ;
12+ }
1013 }
1114 }
12- }
1315
14- Cypress . Commands . add ( 'mount' , mount ) ;
16+ Cypress . Commands . add ( 'mount' , mount ) ;
17+ } ;
18+
19+ // Initialize the mount command
20+ setupMount ( ) ;
Original file line number Diff line number Diff line change 11import './commands' ;
22
3- // Handle WSL2 specific configurations
4- if ( Cypress . platform === 'linux' ) {
3+ // Export the setup function
4+ export const setupWSL2Config = ( ) => {
5+ // Handle WSL2 specific configurations
6+ if ( Cypress . platform === 'linux' ) {
57 Cypress . config ( 'chromeWebSecurity' , false ) ;
68 Cypress . config ( 'baseUrl' , 'http://localhost:3000' ) ;
79
@@ -36,4 +38,7 @@ if (Cypress.platform === 'linux') {
3638
3739 return originalFn ( subject , expectation , ...args ) . catch ( tryAgain ) ;
3840 } ) ;
39- }
41+ } ;
42+
43+ // Initialize the WSL2 configuration
44+ setupWSL2Config ( ) ;
You can’t perform that action at this time.
0 commit comments