question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Testing/Overriding Modules

See original GitHub issue

Apologies if this is a dup (couldn’t see an open issue).

Is there any standard way to do testing. Overriding @Provides or extending module classes.
I know it was discussed by Jake at Devvox that it still needs fleshing out.

What are the current thoughts? This for me is the only real blocker. I can work around the limitations, but it feels like yak-shaving.

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Reactions:2
  • Comments:70 (1 by maintainers)

github_iconTop GitHub Comments

14reactions
mherascommented, Aug 10, 2016

I still think there is no easy and clean way to do it in Android…

2reactions
NitroG42commented, Apr 20, 2016

The documentation makes it a lot better but I still can’t figure out how to do that when we have component dependencies/subcomponent. Basically, if I have an AppComponent (containing the context, for example), and a NetworkComponent that requires a context (that is provided by a module of AppComponent). I want to replace the NetworkComponent by a MockNetworkComponent. I tried both solution (component dependencies/subcomponent), and none worked :

  • With NetworkComponent being a subcomponent, MockNetworkComponent needs to have the same module than NetworkComponent… (so I can’t use MockNetworkModule, I have to use NetworkModule that provide the real implementation).
  • WIth component dependencies, I have to instantiate the DaggerNetworkComponent directly so it’s hard to use DaggerDebugNetworkComponent instead.

Does someone have a solution ? I’m not far from trying Dagger 1 at this point.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Python unit testing overriding module level functions
Is there a way to selectively override a system or module function in the context of my test? Take the following for example...
Read more >
layout_builder_overrides_test.info.yml | Drupal 8.8.x | Drupal API
description: 'Support module for testing overriding layout building.' package: Testing; version: VERSION; core: 8.x ...
Read more >
Overriding Subschemas (Release 10.2) - TechDocs - Broadcom
You can override the program-specified subschema to access a test database that exists in a multiple-database environment. This allows you to perform ...
Read more >
[#MDLQA-2114] OLD 2.2 Assignment Regression Testing ...
OLD 2.2 Assignment Regression Testing: Overriding a grade prevents grade updating in the module. Status: Assignee: Parent: Passed. Andrew Davis.
Read more >
HTTP routes testing - Marble.js
marblejs/testing is a tool agnostic module for testing Marble.js apps. ... initialize environment for testing, overriding and injecting bound dependencies.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found