-
Notifications
You must be signed in to change notification settings - Fork 15
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
[pisp-demo-server] Firebase Unit Tests #1689
Comments
My $0.02 - we should start with solid unit tests on the business domain, and not go into all of the fuss of trying to find the right libraries to do the right things for us, that may not even end up testing 100% of what we want. For testing our model serialization and deserialization, firebase triggers etc. we can then look at proper integration tests with a locally running firebase emulator or something. |
I think you're absolutely right - spent a bunch of time yesterday and today exploring third party mocking libraries + firebase emulator/test solutions and they add unnecessary complexity or added refactoring. Had a discussion with @eoln about this earlier today, and we decided to stick to a barebones jest mocking and just slightly expanding the mocking we already have in place thanks to steven. As you mentioned our focus for unit testing is just to make sure that that we're calling the correct firebase methods with the right parameters, the actual test of functionality should be done through integration testing. |
@lewisdaly we have had a chat with @akapur99 today. I suggested it's not worth to use this simulator because we will have to implement integration tests later so it will be double work. Also using ts-mock-firebase module isn't the option because we both can't install it properly and this project looks parked because of lack of resources. With @akapur99 we agreed that the best option is to extend a little existing mocking https://github.com/mojaloop/pisp-demo-server/blob/master/src/lib/firebase/__mocks__/index.ts and identify patterns in code which wich need testing. Implement one test for each of them, grab experience, make a retro and then discuss together where to go next. |
Cool. Thanks for the updates. |
Currently attempting this via https://github.com/dmurvihill/firebase-mock |
Moving to doing 'bare-minimum' testing using basic jest mocking |
@kkzeng please close after confirming that it's only the repository level code left. |
Goal:
As a
PISP ServerI want to
write unit tests for firebase methods (mocked)so that
I can ensure current and future firebase methods work correctlyComplexity: Low
Uncertainty: Low
Tasks:
Done
Pull Requests:
Follow-up:
Dependencies:
Accountability:
The text was updated successfully, but these errors were encountered: