junlarsen / league-connect

:electric_plug: Node.js HTTP/1.1, HTTP/2.0 and WebSocket interface to the League of Legends Client APIs
https://www.npmjs.com/package/league-connect
MIT License
156 stars 24 forks source link

Regex Unit Testing, Refactoring, and Documentation Cleanup #111

Open EugeneWilson opened 1 year ago

EugeneWilson commented 1 year ago

Description

This PR intends to add unit testing, clean up some documentation, make debugging easier for users, and improve code readability in certain areas. It was important when making these changes to make sure that none of these changes would break the existing code that users have written while using this library, and I believe I've succeeded with that. There are a lot of changes, so I'd love to hear your feedback. I tried to make sure that I documented all the changes in this PR, and I attempted to break it up into multiple small commits to make changes easier to review. However, if I have missed anything or if you have any questions, please let me know.

Changes

Authentication.ts

Authentication.test.ts

Note: PLAINTEXT_CERT doesn't perfectly match the default certificate as it's missing a new line at the beginning. I'm unsure if this was intentional, but I used that difference to do testing with a different certificate.

Webhook.ts

Webhook.test.ts

Client.test.ts

index.ts

junlarsen commented 1 year ago

This is huge, thank you! I'll review it once I have time, hopefully this weekend.