-
Notifications
You must be signed in to change notification settings - Fork 34
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
Add message events #66
Conversation
@@ -33,6 +33,10 @@ describe('EventsService', () => { | |||
eventsService = module.get<EventsService>(EventsService); | |||
}); | |||
|
|||
afterEach(async () => { | |||
jest.clearAllMocks() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this required?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
because this line was not passing https://github.com/safe-global/safe-events-service/pull/66/files#diff-d79512aca03ad68a51d5b4e98066338dcb424638d13712a3f0b9d909ba23ee63R80
looks like mock keep the number of calls between tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This does not sound right, as we are using mocks for same functions and I didn't have to do that, like
const findAllActiveSpy = jest |
This mock is set up again in the next test
I'm not an expert here, so if you think there's no other way around we can do it, but sounds weird
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did it at different way, the issue was that the mock webhookService
was declared globally out of beforeEach
and the spyOn
uses this object that was declared globally, consequently the calls are accumulated between tests.
557981b
to
b2efd58
Compare
Closes #63