Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem while using nest-emitter in E2E tests #36

Open
fr1sk opened this issue Nov 6, 2020 · 2 comments
Open

Problem while using nest-emitter in E2E tests #36

fr1sk opened this issue Nov 6, 2020 · 2 comments

Comments

@fr1sk
Copy link

fr1sk commented Nov 6, 2020

Hello,

Can someone provide a way to .overrideProvider / .useValue while usng nest-emitter.
I got an error in e2e tests when testing service that has @InjectEventEmitter() inside.

This is the error:

Nest can't resolve dependencies of the ConfigurationService (ConfigurationEntityRepository, ?, Logger). Please make sure that the argument __event_emitter__ at index [1] is available in the ConfigurationModule context.
@fr1sk
Copy link
Author

fr1sk commented Dec 29, 2021

since nobody responded, manage to find a solution (year later) 😅

you should import:

NestEmitterModule.forRoot(new EventEmitter())

inside imports section while creating test module.

@grinono
Copy link

grinono commented Jan 14, 2022

@fr1sk the new EventEmitter() is not working here.

EventEmitterModule.forRoot(new EventEmitter2())

i want to publish event from non nest code. Generic functions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants