community
community copied to clipboard
basic testing for automation
- in README.md at the bottom add new section
Developmentand explain that in community repo there is a lot of automation with custom scripts that need proper testing and that this section explains how to run tests and how to add new tests. - add
package.json,package-lock.json- really simplistic, with onlytestscript to run tests. Addjestas test runner - add new folder
testingwith first simple test. The test file name should referr to https://github.com/asyncapi/community/blob/master/.github/scripts/vote_tracker.js as all tests for that script will be in that file - refactor https://github.com/asyncapi/community/blob/master/.github/scripts/vote_tracker.js so
isVotingWithinLastThreeMonthsbecomes a separate function that can be imported to test file and tested with unit tests - mock data for unit tests is already there. Before I added some console log to the script, so in https://github.com/asyncapi/community/actions/runs/13783797336/job/38547070311 you have examples of
voteInfolike for example:
so you can grab it, and modify as you wish inside tests to cover all the test cases{ "name": "derberg", "Budget 2025$$1681": "In favor", "2024 budget refresh and request for urgent pre-approval of some 2025 costs$$1598": "In favor", "Should AsyncAPI Initiative endorse United Nations Global Digital Compact?$$1577": "In favor", "Donate kotlin-asyncapi$$1313": "In favor", "Proposal for Admin Rights for CoC Main Committee on Slack$$[1227](https://github.com/asyncapi/community/actions/runs/13783797336/job/38547070311#step:4:1228)": "In favor", "chore: add Marketing WORKING_GROUP$$1130": "In favor", "docs: add instruction how voting automation works$$1155": "In favor", "lastParticipatedVoteTime": "2025-02-20", "isVotedInLast3Months": true, "lastVoteClosedTime": "2025-03-11", "firstVoteClosedTime": "2024-04-12", "agreeCount": 7, "disagreeCount": 0, "abstainCount": 0, "notParticipatingCount": 0 }
This is a minimal scope to make the review of a PR easier and faster
@Nandgopal-R this is the issue you can work on, that I mentioned in https://github.com/asyncapi/community/pull/1776
@Nandgopal-R this is the issue you can work on, that I mentioned in #1776
Sure, I will begin working on this
@Nandgopal-R any progress?
I became slightly busy due to exams, will put in a pr this week.