test: trim Smart Speed Cypress harness changes

This commit is contained in:
Jonathan Baldie 2026-05-07 20:44:13 +01:00
parent b4a9f8ad59
commit 577f111a17
2 changed files with 1 additions and 80 deletions

View file

@ -25,49 +25,6 @@ import '../../plugins/init.client'
import { mount } from 'cypress/vue2'
const shouldForwardBrowserDebug = () => Boolean(Cypress.env('ABS_CYPRESS_DEBUG_BROWSER'))
const formatErrorDetails = (value) => {
if (!value) return ''
if (value.stack) return value.stack
if (typeof value === 'string') return value
try {
return JSON.stringify(value, null, 2)
} catch {
return String(value)
}
}
const forwardBrowserDebug = (type, message, details) => {
if (!shouldForwardBrowserDebug()) return
cy.task('absCypressDebug', {
type,
message,
details: formatErrorDetails(details)
}, { log: false })
}
if (!window.__absCypressDebugListenersRegistered) {
window.addEventListener('error', (event) => {
forwardBrowserDebug('window-error', event.message || 'Unhandled window error', event.error)
})
window.addEventListener('unhandledrejection', (event) => {
const reason = event.reason
const message = reason?.message || 'Unhandled promise rejection'
forwardBrowserDebug('unhandledrejection', message, reason)
})
Cypress.on('fail', (error, runnable) => {
forwardBrowserDebug('cypress-fail', `${runnable?.fullTitle?.() || 'Unknown test'} failed`, error)
throw error
})
window.__absCypressDebugListenersRegistered = true
}
//Cypress.Commands.add('mount', mount)
Cypress.Commands.add('mount', (component, options = {}) => {