Skip to content

Running code before Application.onCreate #70

@marcoRS

Description

@marcoRS

Does Espresso allow a way to run setup code for tests using AndroidJUnit4.class before Application.onCreate() is called by Instrumentation?

I am using Dagger 2 to inject dependencies in Application.onCreate(). It would be really useful for testing to first be able to set my Components with mock dependencies however I'm finding that Application.onCreate always gets called first before anything else.

I've tried using a static { } block and also @BeforeClass annotation but this doesn't work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions