-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: issue with compilation failures in component testing (#21599)
* fix: issue with compilation failures in component testing * add tests * fix tests * Refactor tests * Fix tests * Refactor tests * Fix tests * Fix paths for dependencies in system tests * Fix tests * Fix tests * Fix tests * Fix tests * test fix for initial esbuild failures * Fix tests * Add back ESLintPlugin * Add comments around our special esbuild handling logic in vite * Code cleanup and additional test scenario * Add config syntax error tests * Improve tests * Update comment and remove unused variable * Remove unneeded hook in webpack dev server * Disable dev server overlay * Revert "Remove unneeded hook in webpack dev server" This reverts commit 98b2f26. * PR comments * Accidental removal * Fix dedent * PR comments
- Loading branch information
1 parent
4e7edda
commit f2bce02
Showing
41 changed files
with
1,455 additions
and
318 deletions.
There are no files selected for viewing
This file contains 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 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 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,37 +1,34 @@ | ||
/// <reference types="cypress" /> | ||
// *********************************************** | ||
// This example commands.ts shows you how to | ||
// create various custom commands and overwrite | ||
// existing commands. | ||
// | ||
// For more comprehensive examples of custom | ||
// commands please read more here: | ||
// https://on.cypress.io/custom-commands | ||
// *********************************************** | ||
// | ||
// | ||
// -- This is a parent command -- | ||
// Cypress.Commands.add('login', (email, password) => { ... }) | ||
// | ||
// | ||
// -- This is a child command -- | ||
// Cypress.Commands.add('drag', { prevSubject: 'element'}, (subject, options) => { ... }) | ||
// | ||
// | ||
// -- This is a dual command -- | ||
// Cypress.Commands.add('dismiss', { prevSubject: 'optional'}, (subject, options) => { ... }) | ||
// | ||
// | ||
// -- This will overwrite an existing command -- | ||
// Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... }) | ||
// | ||
// declare global { | ||
// namespace Cypress { | ||
// interface Chainable { | ||
// login(email: string, password: string): Chainable<void> | ||
// drag(subject: string, options?: Partial<TypeOptions>): Chainable<Element> | ||
// dismiss(subject: string, options?: Partial<TypeOptions>): Chainable<Element> | ||
// visit(originalFn: CommandOriginalFn, url: string, options: Partial<VisitOptions>): Chainable<Element> | ||
// } | ||
// } | ||
// } | ||
|
||
declare global { | ||
namespace Cypress { | ||
interface Chainable { | ||
/** | ||
* Adapter to wait for a spec to finish in a standard way. It | ||
* | ||
* 1. Waits for the stats to reset which signifies that the test page has loaded | ||
* 2. Waits for 'Your tests are loading...' to not be present so that we know the tests themselves have loaded | ||
* 3. Waits (with a timeout of 30s) for the Rerun all tests button to be present. This ensures all tests have completed | ||
* | ||
*/ | ||
waitForSpecToFinish() | ||
} | ||
} | ||
} | ||
|
||
// Here we export the function with no intention to import it | ||
// This only tells the typescript type checker that this definitely is a module | ||
// This way, we are allowed to use the global namespace declaration | ||
export const waitForSpecToFinish = () => { | ||
// First ensure the test is loaded | ||
cy.get('.passed > .num').should('contain', '--') | ||
cy.get('.failed > .num').should('contain', '--') | ||
|
||
// Then ensure the tests are running | ||
cy.contains('Your tests are loading...').should('not.exist') | ||
|
||
// Then ensure the tests have finished | ||
cy.get('[aria-label="Rerun all tests"]', { timeout: 30000 }) | ||
} | ||
|
||
Cypress.Commands.add('waitForSpecToFinish', waitForSpecToFinish) |
This file contains 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 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 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
30 changes: 29 additions & 1 deletion
30
npm/webpack-dev-server/__snapshots__/makeWebpackConfig.spec.ts.js
This file contains 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 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 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 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
Oops, something went wrong.
f2bce02
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.
Circle has built the
linux x64
version of the Test Runner.Learn more about this pre-release platform-specific build at https://on.cypress.io/installing-cypress#Install-pre-release-version.
Run this command to install the pre-release locally:
f2bce02
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.
Circle has built the
darwin x64
version of the Test Runner.Learn more about this pre-release platform-specific build at https://on.cypress.io/installing-cypress#Install-pre-release-version.
Run this command to install the pre-release locally:
f2bce02
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.
Circle has built the
win32 x64
version of the Test Runner.Learn more about this pre-release platform-specific build at https://on.cypress.io/installing-cypress#Install-pre-release-version.
Run this command to install the pre-release locally: