mirror of
				https://github.com/aleleba/create-react-ssr.git
				synced 2025-11-04 07:55:40 -06:00 
			
		
		
		
	PR-579798: trying to fix Cypress component testing.
This commit is contained in:
		@@ -17,12 +17,12 @@
 | 
				
			|||||||
import '../../src/frontend/styles/global.scss';
 | 
					import '../../src/frontend/styles/global.scss';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Import commands.js using ES2015 syntax:
 | 
					// Import commands.js using ES2015 syntax:
 | 
				
			||||||
import './commands'
 | 
					import './commands';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Alternatively you can use CommonJS syntax:
 | 
					// Alternatively you can use CommonJS syntax:
 | 
				
			||||||
// require('./commands')
 | 
					// require('./commands')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import { mount } from 'cypress/react18'
 | 
					import { mount } from 'cypress/react18';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Augment the Cypress namespace to include type definitions for
 | 
					// Augment the Cypress namespace to include type definitions for
 | 
				
			||||||
// your custom command.
 | 
					// your custom command.
 | 
				
			||||||
@@ -36,7 +36,12 @@ declare global {
 | 
				
			|||||||
  }
 | 
					  }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Cypress.Commands.add('mount', mount)
 | 
					Cypress.Commands.add('mount', mount);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Cypress.on('uncaught:exception', (err, runnable) => {
 | 
				
			||||||
 | 
						// returning false here prevents Cypress from failing the test
 | 
				
			||||||
 | 
						return false;
 | 
				
			||||||
 | 
					});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Example use:
 | 
					// Example use:
 | 
				
			||||||
// cy.mount(<MyComponent />)
 | 
					// cy.mount(<MyComponent />)
 | 
				
			||||||
@@ -14,7 +14,7 @@
 | 
				
			|||||||
// ***********************************************************
 | 
					// ***********************************************************
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Import commands.js using ES2015 syntax:
 | 
					// Import commands.js using ES2015 syntax:
 | 
				
			||||||
import './commands'
 | 
					import './commands';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Alternatively you can use CommonJS syntax:
 | 
					// Alternatively you can use CommonJS syntax:
 | 
				
			||||||
// require('./commands')
 | 
					// require('./commands')
 | 
				
			||||||
		Reference in New Issue
	
	Block a user