https://cypress.io logo
Extending the cypress debugging?
# i-need-help
c
Niche question, here: Does anyone have any examples of how we can extend the debugging in cypress so that I can log various things at the CLI during
cypress run
?
e
c
So, I've read this page inside and out and I'm not sure if it's because my project is in typescript, but even when I add
debug
to my project (and
@types/debug
), the output of
debug
(and
console.error
) seems supressed when I run
npx cypress run
...
e
When I did this I added it directly to the run command itself
DEBUG=cypress:* cypress run
...etc And that's not working?
c
the thing is that I want to add my own extra logging to that
DEBUG
. E.g.,
DEBUG=myApp cypress run
should output my logs. But instead, debug statements get suppressed. I've tested this in a simple
index.ts
script that isn't run inside cypress and I don't get any issues.
E.g.
Copy code
DEBUG=myApp ts-node index.ts
To be clear, I'd love
Copy code
DEBUG=* cypress run
to output not only the cypress debugging, but my debugging as well.
m
@colossal-oxygen-29599 DEBUG=* only affects debug statements written using the https://www.npmjs.com/package/debug utility, so it sounds like there is some confusion about what this does.
c
what I'm saying is that I've installed
debug
, and
@types/debug
, and I was able to use it outside of cypress, yet the output doesn't show up when I use it during
cypress run
(or
cypress open
)
m
So are you saying that you added `debug()`statements to your own code e.g. into your
index.ts
?
c
@many-airline-45402 that's correct
m
Thank you for clarifying and my apologies for misunderstanding what you are doing!
e
I also misunderstood what you wanted to do, my apologies @colossal-oxygen-29599. I'm not familiar with adding custom debug statements but I'll see if I can find anything