Files
compiler-explorer/cypress/support/utils.ts
Matt Godbolt 23fad10939 Unit testing the frontend (#7829)
This adds some unit tests for the front end.

- configures "frontend tests" as a unit tests in `static/tests`,
removing the old cypress-requiring "unit" tests
- hack enough of a DOM  to get things working
- port motd and id tests
- *adds* a golden layout checks  (see #7807)
- Updates READMEs etc

---------

Co-authored-by: Claude <noreply@anthropic.com>
2025-06-19 08:46:57 -05:00

14 lines
450 B
TypeScript

import '../../static/global';
export function stubConsoleOutput(win: Cypress.AUTWindow) {
cy.stub(win.console, 'log').as('consoleLog');
cy.stub(win.console, 'warn').as('consoleWarn');
cy.stub(win.console, 'error').as('consoleError');
}
export function assertNoConsoleOutput() {
cy.get('@consoleLog').should('not.be.called');
cy.get('@consoleWarn').should('not.be.called');
cy.get('@consoleError').should('not.be.called');
}