-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
[enhancement]: Test suite with code coverage #43
Comments
I didn't see Jest in package.json should I install it? |
Hi @Tusharjagi, Thank you for your interest towards contributing to FreeApi.app currently the test suite setup is under progress. We are commiting the code under branch You can add jest, supertest & update the test script in package.json I am also expecting to have a babel configuration json file that will include the presets & plugins necessary for the project. You can start with the base healthcheck API endpoint with a base test case for it to expect 200 as status code on making async call. I would see this as a good starting point for our enhancement |
Sure @jwala-anirudh I will investigate it, Firstly I need to understand the code base, and then I will raise a PR for it, If I have another query I will reach out to you ... |
how about playwright? |
Any update on this one? playwright seems a good option. |
Alright, let me get started with playwright then 👍🏻 |
Hello @jwala-anirudh , I have one question why we are using playwright for api testing as per my understanding it's used E2E testing for web apps can you explain bit more how we are going to add unit test using playwright or i'm missing something ?? |
@shrey-dadhaniya Yes the Playwright is more favourable for browser based E2E tests but it also provides an API testing module which I think is enough for our use case and has really simple apis to just do high level testing. We could've gone for something like Jest or Mocha but our main focus is on business logic and working on the core functionality rather than robust testing. However, we understand that doing testing is best practice and it eliminates manual testing work upon doing some major changes. Playwright API testing reference: https://playwright.dev/docs/api-testing @jwala-anirudh correct me if I'm wrong Thanks! |
@wajeshubham Thanks. |
@shrey-dadhaniya available on |
I have started adding test cases I want to make sure i'm going in right direction. Thanks! |
@shrey-dadhaniya why do you have yarn-lock and package-lock in the commit? should'nt you be using only one package manager |
yes, you are right. Thanks for reviewing my code @theunhackable, I really appreciate that 😇 |
Hello @jwala-anirudh , @wajeshubham, I think we should devide this issue in to multiple smaller issues or PR because it is time consuming task and we can not wait untill everything in done. My suggestion is we can devide like
once core setup is done for BE and FE then multiple developers can work separately on different apps what are your suggestions? Thanks. |
@shrey-dadhaniya This issue is only targeting backend testing and that too on a higher level. We are not focusing on the front-end testing as it will be done by the contributors creating the front-end apps which is optional. |
@wajeshubham Okay.we can still divide BE test cases into multiple PRs. what you think?
|
@shrey-dadhaniya That is right, we expect this to be delivered in multiple PRs rather than one. |
@jwala-anirudh how we want to proceed? I will rais PR for master branch ? and what about git workflow I suggest we should add workflow that run test when anyone create PR. what is your input ? |
@shrey-dadhaniya Let's first start with the testing. Workflows and pipelines we can implement later. Also, please read the contribution guide, we have mentioned everything regarding how to contribute there. Thanks |
@wajeshubham yes right but my question is we have already branch feat/coverage that is created by someone my code is dependent on that branch i can create one branch where i setup playwright and add test case for health function then we merge that branch to master and then we can proceed with app wise PR what you suggest? |
Ok, raise PR to the feat/coverage branch. |
Todo and health check is done now I think i should take more easy app to test so i'm thinking to add Database Seeding @wajeshubham, @jwala-anirudh give me green flag and i will start working on that |
Yes you can proceed! cc: @jwala-anirudh |
Hi @jwala-anirudh, PR #81 has been merged. Just a reminder to ensure that this branch is prepared for merging into the |
what is next we decide to merge master branch and then will continue to add test for other apps and also update readme. how we are going to proceed from here? @jwala-anirudh @wajeshubham please advise |
Hello, @wajeshubham give me green flag to start work |
Sounds good @shrey-dadhaniya - you can start, please open a draft PR once you complete 50% of work |
Background
FreeApi.app as of today doesn't come with any test cases writtern for the application. I want to keep this as a open issue until we reach the goal of 50% coverage in phase 1.
Phase 2 would be to reach min code coverage of 80% for every subsequent release.
Plan
Outcome
Additional information
We will not be closing this issue until the stated Phases are achieved. Until then all are welcomed to contribute
The text was updated successfully, but these errors were encountered: