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

Add message events #66

Merged
merged 2 commits into from
Aug 31, 2023
Merged

Add message events #66

merged 2 commits into from
Aug 31, 2023

Conversation

moisses89
Copy link
Member

Closes #63

  • Add events to readme
  • Add events test

@moisses89 moisses89 requested a review from Uxio0 as a code owner August 29, 2023 08:56
@@ -33,6 +33,10 @@ describe('EventsService', () => {
eventsService = module.get<EventsService>(EventsService);
});

afterEach(async () => {
jest.clearAllMocks()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this required?

Copy link
Member Author

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.

Copy link
Member

@Uxio0 Uxio0 Aug 29, 2023

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

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

Copy link
Member Author

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.

@moisses89 moisses89 requested a review from Uxio0 August 30, 2023 10:10
@Uxio0 Uxio0 merged commit ce221a9 into main Aug 31, 2023
8 checks passed
@Uxio0 Uxio0 deleted the add_message_events branch August 31, 2023 10:35
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

Successfully merging this pull request may close these issues.

Add new Messages events
2 participants