-
Notifications
You must be signed in to change notification settings - Fork 449
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
Add generic types and update tests #107
Add generic types and update tests #107
Conversation
@developit LMK what you think, thanks! |
* Add generic types to `on`, `off` and `emit` to enable some nicer TS usage if you specify what type you're expecting from the `EventData`. * Move the tests to be TypeScript source. This will help catch errors in the tests if there are any type errors. * Create a new test to test the generic types and make sure they pass and error when expected. * Upgrade to Mocha 8. * Did some tidying up of the package.json scripts.
0bbd238
to
28fcc9e
Compare
@developit let me know if I can help do anything to help this ship, thanks! |
Will get to this today! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good - only tiny nit is that I'd prefer to use a "mocha" package.json field, but I'm happy to do that post-merge.
Ah also some sneaky TS errors in the CI output. I think I have a fix in Codespaces, will check tomorrow morning. |
Shipped as 2.1.0, no longer a preview release :) |
on
,off
andemit
to enable some nicer TSusage if you specify what type you're expecting from the
EventData
.the tests if there are any type errors.
and error when expected.