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.

TestingModuleBuilder is missing overrideModule

See original GitHub issue

Feature Request

Is your feature request related to a problem? Please describe.

I want to use mock modules to override functionalities of the module instead of overriding internals of the module again and again.

Describe the solution you’d like

A overrideModule method similar to overrideProvider would solve the issue, example:

Test.createTestingModule({
  ...
})
  .overrideModule(LoggerModule)
  .useClass(LoggerTestingModule)
  .compile();

What is the motivation / use case for changing the behavior?

For the cases of e2e / integration testing in a project with many encapsulated libraries / modules it would be very helpful to be able to override entire modules instead of overriding internals of the modules every time the module is part of a testing module.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:26
  • Comments:12 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
jdelgadofrtscommented, Jun 28, 2022

Do we have any updates on the PR? https://github.com/nestjs/nest/pull/8777

I could really use this feature! 😃

3reactions
oschlegelcommented, Jun 29, 2020

I will build a solution if i can find some time

Read more comments on GitHub >

github_iconTop Results From Across the Web

Testing | NestJS - A progressive Node.js framework
Nest is a framework for building efficient, scalable Node.js server-side applications. It uses progressive JavaScript, is built with TypeScript and combines ...
Read more >
nestjs/testing.TestingModuleBuilder.createTestingModule ...
Best JavaScript code snippets using @nestjs/testing.TestingModuleBuilder.createTestingModule(Showing top 15 results out of 1,395).
Read more >
angular Testbed overrideModule not working - Stack Overflow
So in fact we don't add it to the test module's declaration, but to the original Module: // Add the imported module to...
Read more >
HOW TO GET THE TEST OVERRIDE MODULE IN ... - YouTube
HOW TO GET THE TEST OVERRIDE MODULE IN SUBNAUTICA BELOW ZERO ... Merchandise ▻ https://teespring.com/stores/ miss -luc.
Read more >
Test Override Module Subnautica Below Zero - YouTube
In this video I will show you the location where you can find the test override module blueprint Subnautica Below Zero.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

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