How can an application tell if it's running under an 'sbt test' context? Is there a system property that can be checked?
There are probably different ways. I found the following works:
testOptions += Tests.Setup(_ => sys.props("testing") = "true")
And then you can just test for sys.props.get("testing")
in your class.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With