warengonzaga / gathertown.js

Simple and lightweight community contributed unofficial JS/TS SDK for Gather Town's HTTPS and WebSocket APIs. 🌏🕹💬
https://gathertown.js.org
MIT License
40 stars 6 forks source link

parcel typechecking and initial setup for automated tests #39

Closed princejoogie closed 2 years ago

princejoogie commented 2 years ago

This PR includes the setup for parcel type-checking and the initial setup for automated tests with jest.

Automated tests

when running the tests, it also includes code coverage. image

besides the results in the terminal, it also creates a coverage/ folder in root which we can host in gh pages to visualize code coverage. it look like this: image

i've only included initial setup for jest and will complete all the unit tests when we have a dedicated gathertown account for testing as it will need an api key.

Type checking

here's a quick test of the type checking, manually removing a required function in the return statement. image

and here's is parcel screaming at me XD image


PS. about 14 files are generated by jest under coverage/ folder which populates this PR, dont panic 😎

warengonzaga commented 2 years ago

I like it @princejoogie I'll take a look into it.

warengonzaga commented 2 years ago

Can you document how to test our API client? @princejoogie

princejoogie commented 2 years ago

Can you document how to test our API client? @princejoogie

simply run yarn test

when will we have a dev account for gathertown? for the apikey

warengonzaga commented 2 years ago

Can you document how to test our API client? @princejoogie

simply run yarn test

when will we have a dev account for gathertown? for the apikey

Alright, I will create one and send it to you via Discord.