Skip to content
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

Merged
merged 6 commits into from
Jul 15, 2020

Conversation

jackfranklin
Copy link
Contributor

@jackfranklin jackfranklin commented Jun 18, 2020

  • 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.

@jackfranklin
Copy link
Contributor Author

@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.
@jackfranklin jackfranklin force-pushed the mochav8-and-typescript branch from 0bbd238 to 28fcc9e Compare June 18, 2020 19:11
@jackfranklin
Copy link
Contributor Author

@developit let me know if I can help do anything to help this ship, thanks!

@developit
Copy link
Owner

Will get to this today!

Copy link
Owner

@developit developit left a 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.

@developit
Copy link
Owner

Ah also some sneaky TS errors in the CI output. I think I have a fix in Codespaces, will check tomorrow morning.

@developit developit merged commit 5116df4 into developit:master Jul 15, 2020
@developit
Copy link
Owner

Shipped as 2.1.0, no longer a preview release :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants