scala - How to get the name of the current scalajs / uTest test case -
how can name of running utest test case?
during test case use println(...) or log.debug(...) print , check various values. @ beginning of test case print name of test case.
i can this:
object mytests extends testsuite def tests = testsuite { "mytest01" - { println("mytest01 starting ***************************************************") val x = thing.docomplexcalc println("x = " + x ) val y = anotherthing.dosomethingmore( x ) println("y = " + y ) assert(y=="mysterious output") } } }
in (extremely simplified) example "mytest01" duplicated. i'm looking way remove duplication, e.g. this:
object mytests extends testsuite def tests = testsuite { "mytest01" - { println(gettest().name + " starting ***************************************************") val x = thing.docomplexcalc println("x = " + x ) val y = anotherthing.dosomethingmore( x ) println("y = " + y ) assert(y=="mysterious output") } } }
test name available tests.toseq().name how know case running if run parallel using sbt.
it's not available right now. there's open issue make so
Comments
Post a Comment