This repository was archived by the owner on Mar 5, 2022. It is now read-only.
- Notifications
You must be signed in to change notification settings - Fork 78
Addons for #37: Module cache, more cy.get aliases, typings for TS #45
Merged
bahmutov merged 15 commits into cypress-io:master from RcKeller:changes/versioning-fixes Feb 18, 2019
Merged
Changes from all commits
Commits
Show all changes
15 commits Select commit Hold shift + click to select a range
2866434 Fixed users spec - had race condition
8b8831f Drafted cypress commands
6c46a7a Lib functions as commands. Use node_modules for loading React
7b786cd Switch over to using cy.mount. Docs updated
c5b3234 Version bumping incl. babel@7
5a4f2a8 Added error boundaries - good example component
ec8836f Line about err boundary component
29416d3 Only load modules once. Refactoring
10220ed Bookmarking this for now
876c692 modules fixture
62e4587 Use react displaynames
bf4b145 Overrode cy.get() to support JSX
9280c1b Updated README.md
8757ece Resolving merge w/ upstream
39e6f44 Add typings
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| [ | ||
| { | ||
| "name": "react", | ||
| "type": "file", | ||
| "location": "node_modules/react/umd/react.development.js" | ||
| }, | ||
| { | ||
| "name": "react-dom", | ||
| "type": "file", | ||
| "location": "node_modules/react-dom/umd/react-dom.development.js" | ||
| } | ||
| ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| declare namespace Cypress { | ||
| Contributor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. super, adding types for new | ||
| interface Cypress { | ||
| stylesCache: any | ||
| React: string | ||
| ReactDOM: string | ||
| Styles: string | ||
| } | ||
| // NOTE: By default, avoiding React.Component/Element typings | ||
| // for many cases, we don't want to import @types/react | ||
| interface Chainable<Subject = any> { | ||
| injectReactDOM: () => Chainable<void> | ||
| copyComponentStyles: (component: Symbol) => Chainable<void> | ||
| mount: (component: Symbol, alias?: string) => Chainable<void> | ||
| get<S = any>(alias: string | symbol | Function, options?: Partial<Loggable & Timeoutable>): Chainable<any> | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,24 @@ | ||
| /* | ||
| Before All | ||
| - Load and cache UMD modules specified in fixtures/modules.json | ||
| These scripts are inlined in the document during unit tests | ||
| modules.json should be an array, which implicitly sets the loading order | ||
| Format: [{name, type, location}, ...] | ||
| */ | ||
| before(() => { | ||
| Cypress.modules = [] | ||
| cy.log('Initializing UMD module cache') | ||
| Contributor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. interesting solution here, really interesting | ||
| .fixture('modules') | ||
| .then((modules = []) => { | ||
| for (const module of modules) { | ||
| let { name, type, location } = module | ||
| cy.log(`Loading ${name} via ${type}`) | ||
| .readFile(location) | ||
| .then(source => Cypress.modules.push({ name, type, location, source })) | ||
| } | ||
| }) | ||
| }) | ||
| | ||
| // *********************************************************** | ||
| // This example support/index.js is processed and | ||
| // loaded automatically before your test files. | ||
| | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice!