Join Slack
Powered by
How to check if code is running in test mode (unit...
# javascript
p
PHondogo
06/18/2025, 8:46 PM
How to check if code is running in test mode (unit test)?
e
Edoardo Luppi
06/19/2025, 8:42 AM
I don't think there a "native" way to do it. But you can insert a compile time constant, different depending on the compilation mode.
p
PHondogo
06/19/2025, 1:25 PM
Thought may be there is possibility for example register some window/document property before run test and check for it in code.
e
Edoardo Luppi
06/19/2025, 1:28 PM
See
https://github.com/yshrsmz/BuildKonfig
Edoardo Luppi
06/19/2025, 1:29 PM
Or
https://github.com/gmazzo/gradle-buildconfig-plugin
2
Views
Open in Slack
Previous
Next