I want to use VS Code to edit and debug Cypress tests. It seems like this should be simple; the cypress docs mention VS Code directly (but give no clues about how to configure
I set this up today and it worked!
module.exports = (on, config) => {
on('before:browser:launch', (browser = {}, args) => {
if (browser.name === 'chrome') {
args.push('--remote-debugging-port=9222')
// whatever you return here becomes the new args
return args
}
})
}
Cypress Browser Launch API
{
"type": "chrome",
"request": "attach",
"name": "Attach to Chrome",
"port": 9222,
"urlFilter": "http://localhost:4200/*",
"webRoot": "${workspaceFolder}"
}