Can I set a test environment variable lazily? ```t...
# community-support
m
Can I set a test environment variable lazily?
Copy code
tasks.withType(Test::class.java).configureEach {
  // How do I do this?
  environment("NAME", provider { computeValue() })
}
There is
environment(String name, Object value)
but looks like it calls
value.toString()
e
the usual workaround for that and other old apis that stringify lazily instead of using providers,
Copy code
object {
    override fun toString(): String = provider.get()
}
💡 1
m
Thanks!