spek icon indicating copy to clipboard operation
spek copied to clipboard

How to use Android Instrumentation with Spek?

Open ssputay opened this issue 5 years ago • 0 comments

I'm getting the following error: No instrumentation registered! Must run under a registering instrumentation. when running this test:

class EnvironmentSpec : Spek({

    Feature("Environment Initialization Test") {
        val context = InstrumentationRegistry.getInstrumentation().context

        Scenario("Loading a valid environment bundle") {
            Given("A valid config") {
                // context required for config
            }
            When("Initializing an Environment") {}
            Then("Environment is initialized successfully") {}
        }
    }
})

ssputay avatar Apr 08 '20 12:04 ssputay