Page 1 of 1

Detect if code coverage is requested within test instance

Posted: Tue Dec 19, 2023 12:16 pm
by laura

Hi,
we use Siesta for Ext.js.
Is there a way to detect if a test is currently running with code coverage? We are looking for a way to add tests based on content changes that won't work in case of coverage generation because of the coverage injections

Thanks for help


Re: Detect if code coverage is requested within test instance

Posted: Tue Dec 19, 2023 12:34 pm
by nickolay

Hi,

When code is is running with code coverage instrumentation, the window.__coverage__ global is created. You should be able to check for its presence.


Re: Detect if code coverage is requested within test instance

Posted: Wed Dec 20, 2023 7:06 am
by laura

That works fine, thank you!