mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-05-26 13:21:31 +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,36 +5,36 @@ module.exports = defineConfig({
|
|||
env: {
|
||||
ABS_CYPRESS_DEBUG_BROWSER: false
|
||||
},
|
||||
e2e: {
|
||||
setupNodeEvents(on, config) {
|
||||
on('task', {
|
||||
absCypressDebug(payload) {
|
||||
const prefix = `[cypress:${payload.type}]`
|
||||
const message = typeof payload.message === 'string' ? payload.message : JSON.stringify(payload.message)
|
||||
const details = payload.details ? `\n${payload.details}` : ''
|
||||
setupNodeEvents(on, config) {
|
||||
on('task', {
|
||||
absCypressDebug(payload) {
|
||||
const prefix = `[cypress:${payload.type}]`
|
||||
const message = typeof payload.message === 'string' ? payload.message : JSON.stringify(payload.message)
|
||||
const details = payload.details ? `\n${payload.details}` : ''
|
||||
|
||||
// Surface browser-side failures in terminal output for focused debug runs.
|
||||
console.error(`${prefix} ${message}${details}`)
|
||||
return null
|
||||
}
|
||||
})
|
||||
|
||||
on('before:browser:launch', (browser, launchOptions) => {
|
||||
if (!config.env.ABS_CYPRESS_DEBUG_BROWSER) {
|
||||
return launchOptions
|
||||
}
|
||||
|
||||
if (browser.family === 'chromium') {
|
||||
launchOptions.args.push('--auto-open-devtools-for-tabs')
|
||||
launchOptions.args.push('--enable-logging=stderr')
|
||||
launchOptions.args.push('--v=1')
|
||||
}
|
||||
// Surface browser-side failures in terminal output for focused debug runs.
|
||||
console.error(`${prefix} ${message}${details}`)
|
||||
return null
|
||||
}
|
||||
})
|
||||
|
||||
on('before:browser:launch', (browser, launchOptions) => {
|
||||
if (!config.env.ABS_CYPRESS_DEBUG_BROWSER) {
|
||||
return launchOptions
|
||||
})
|
||||
}
|
||||
|
||||
return config
|
||||
}
|
||||
if (browser.family === 'chromium') {
|
||||
launchOptions.args.push('--auto-open-devtools-for-tabs')
|
||||
launchOptions.args.push('--enable-logging=stderr')
|
||||
launchOptions.args.push('--v=1')
|
||||
}
|
||||
|
||||
return launchOptions
|
||||
})
|
||||
|
||||
return config
|
||||
},
|
||||
e2e: {
|
||||
},
|
||||
component: {
|
||||
devServer: {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue