I am writing unit tests for my Kotlin client-side javascript code. The client code needs the support...
v
I am writing unit tests for my Kotlin client-side javascript code. The client code needs the support of a server which is also written in Kotlin in the same multiplatform Kotlin project. How can I start the server automatically when the unit tests start?
e
a. that doesn't sound appropriate for a unit test b. in general, can be done by defining your own BuildService which can be added to the existing tasks with Task.usesService() or wired into new tasks automatically
v
Afair
usesService
is only necessary when you want to restrict concurrent usage of the service to a certain amount, so that Gale knows which tasks use which service. If the concurrent usage of the service is not limited, you can just use it. Besides that it indeed does not sound appropriate for a unit test, and I'm not sure whether a build service can run the server code within the same project.