0
@RunWith(RobolectricTestRunner::class)
class ServerUnitTest {
    @Test
    fun localAccessTest() {
        runTest {
            val res = LocalAccess.pingServer()
            assertEquals(res, 0)
            }
    }
}

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ':app:testArtlocalDebugUnitTest'.

No tests found for given includes: [server.ServerUnitTest.localAccessTest](--tests filter)

If I remove '@RunWith(RobolectricTestRunner::class)', the test runs but there is no App Context -> so crash. LocalAccess requires App Context.

1
  • There are already a lot of question here revolving around this error message: stackoverflow.com/…. Are you sure none of the answers there solves your issue? Please edit the question and explain what you have tried so far. Commented Oct 7 at 14:15

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.