Skip to content
This repository was archived by the owner on Mar 5, 2022. It is now read-only.

Conversation

@RcKeller
Copy link

Based on feedback from #37 (thanks for merging!)

  • Added a modules.json fixture to specify modules & their load order.
  • Modules are now read once in a beforeAll hook and kept in memory.
  • Some tweaks to use Cypress instead of cy when appropriate.
  • Overrode cy.get() to support three different selectors: @DisplayName, <JSX /> or the React.Component itself. Did this in a way so that you didn't have to load React into memory for typechecking component instances.
@bahmutov
Copy link
Contributor

@RcKeller this is an incredible contribution, would you like to join as a collaborator?

@example cy.get(<Component />)
@example cy.get(Component)
**/
Cypress.Commands.overwrite('get', (originalFn, selector, options) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice!

@@ -0,0 +1,16 @@
declare namespace Cypress {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

super, adding types for new cy methods

*/
before(() => {
Cypress.modules = []
cy.log('Initializing UMD module cache')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

interesting solution here, really interesting

@bahmutov bahmutov merged commit 54700c5 into cypress-io:master Feb 18, 2019
@RcKeller
Copy link
Author

@RcKeller this is an incredible contribution, would you like to join as a collaborator?

Gladly - thank you!

dmtrKovalenko pushed a commit to cypress-io/cypress that referenced this pull request Oct 1, 2020
…ypress-react-unit-test#45) * Fixed users spec - had race condition * Drafted cypress commands * Lib functions as commands. Use node_modules for loading React * Switch over to using cy.mount. Docs updated * Version bumping incl. babel@7 * Added error boundaries - good example component * Line about err boundary component * Only load modules once. Refactoring * Bookmarking this for now * modules fixture * Use react displaynames * Overrode cy.get() to support JSX * Updated README.md * Add typings
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

2 participants