mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-05-29 14:51:45 +00:00
fix Cypress component debug hook registration
This commit is contained in:
parent
1fd5c205a9
commit
74755e51d8
2 changed files with 42 additions and 38 deletions
|
|
@ -5,7 +5,6 @@ module.exports = defineConfig({
|
||||||
env: {
|
env: {
|
||||||
ABS_CYPRESS_DEBUG_BROWSER: false
|
ABS_CYPRESS_DEBUG_BROWSER: false
|
||||||
},
|
},
|
||||||
e2e: {
|
|
||||||
setupNodeEvents(on, config) {
|
setupNodeEvents(on, config) {
|
||||||
on('task', {
|
on('task', {
|
||||||
absCypressDebug(payload) {
|
absCypressDebug(payload) {
|
||||||
|
|
@ -34,7 +33,8 @@ module.exports = defineConfig({
|
||||||
})
|
})
|
||||||
|
|
||||||
return config
|
return config
|
||||||
}
|
},
|
||||||
|
e2e: {
|
||||||
},
|
},
|
||||||
component: {
|
component: {
|
||||||
devServer: {
|
devServer: {
|
||||||
|
|
|
||||||
|
|
@ -49,6 +49,7 @@ const forwardBrowserDebug = (type, message, details) => {
|
||||||
}, { log: false })
|
}, { log: false })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!window.__absCypressDebugListenersRegistered) {
|
||||||
window.addEventListener('error', (event) => {
|
window.addEventListener('error', (event) => {
|
||||||
forwardBrowserDebug('window-error', event.message || 'Unhandled window error', event.error)
|
forwardBrowserDebug('window-error', event.message || 'Unhandled window error', event.error)
|
||||||
})
|
})
|
||||||
|
|
@ -64,6 +65,9 @@ Cypress.on('fail', (error, runnable) => {
|
||||||
throw error
|
throw error
|
||||||
})
|
})
|
||||||
|
|
||||||
|
window.__absCypressDebugListenersRegistered = true
|
||||||
|
}
|
||||||
|
|
||||||
//Cypress.Commands.add('mount', mount)
|
//Cypress.Commands.add('mount', mount)
|
||||||
Cypress.Commands.add('mount', (component, options = {}) => {
|
Cypress.Commands.add('mount', (component, options = {}) => {
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue