You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
for purpose of unit testing & integration testing, is there any way of having lifecycle events executed with TestingModule without calling createApplication? It would be great if you wouldn't have to start express server for each unit test and would have Init and Destroy lifecycle events properly executed after compilation of a testing module, or after calling some kind of init().
[ ] Regression
[ ] Bug report
[x ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead post your question on Stack Overflow.
Current behavior
Lifecycle events not being executed within TestModule without creating express application.
Expected behavior
Lifecycle events get executed within TestModule after compilation or after calling some kind of init() or createApplicationContext().
Minimal reproduction of the problem with instructions
In this example, if CommonModule has lots of services which need proper initialisation and cleanup in OnModuleInit & OnModuleDestroy handlers, we are not able to init() the module without calling createApplication which will start express server.
What is the motivation / use case for changing the behavior?
Environment
Nest version: 5.7.1
For Tooling issues:
- Node version: 10.14.0
- Platform: Mac
Others:
Many thanks
The text was updated successfully, but these errors were encountered:
kamilmysliwiec
changed the title
TestingModule lifecycle events
Add init() to the application context interface
Feb 28, 2019
Hi guys,
for purpose of unit testing & integration testing, is there any way of having lifecycle events executed with
TestingModule
without callingcreateApplication
? It would be great if you wouldn't have to start express server for each unit test and would haveInit
andDestroy
lifecycle events properly executed after compilation of a testing module, or after calling some kind ofinit()
.Current behavior
Lifecycle events not being executed within
TestModule
without creating express application.Expected behavior
Lifecycle events get executed within
TestModule
after compilation or after calling some kind ofinit()
orcreateApplicationContext()
.Minimal reproduction of the problem with instructions
In this example, if
CommonModule
has lots of services which need proper initialisation and cleanup inOnModuleInit
&OnModuleDestroy
handlers, we are not able toinit()
the module without callingcreateApplication
which will start express server.What is the motivation / use case for changing the behavior?
Environment
Many thanks
The text was updated successfully, but these errors were encountered: