veliovgroup / flow-router

🚦 Carefully extended flow-router for Meteor
https://packosphere.com/ostrio/flow-router-extra
BSD 3-Clause "New" or "Revised" License
201 stars 30 forks source link

TypeScript definition tests (QA) #98

Closed dr-dimitru closed 6 months ago

dr-dimitru commented 1 year ago

@timsun28

To keep the discussion going here, i've copied my message from the merged pr:

I have taken a look at the other meteor packages that have implemented the same zodern package and it seems like they are already completely developed in typescript itself.

I read some more about general ways of testing typescript and I think the following article describes it well: https://developers.mews.com/why-we-should-all-be-testing-our-typescript-types/ I think testing it with typescript itself would be most interesting to add. This would mean changing the test files to typescript files and see if there are any unexpected errors, and possibly add some tests to describe cases where typescript should give an error.

However, I've tried converting a .spec.js file to .ts, but it doesn't seem to recognize the types in my vscode. I've tried adding typescript as a npm dev dependency, and i've added a tsconfig.json file, but without any luck, unfortunately.

As an example of how DefinetelyTyped is tested you can see the meteor package: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/meteor/test And one of the apps mentioned by zoder already has all their code in a .ts file like this: https://github.com/wildhart/meteor.jobs https://github.com/meteor/react-packages/tree/master/packages/react-meteor-accounts https://github.com/zodern/meteor-pure-admin

Originally posted by @timsun28 in https://github.com/veliovgroup/flow-router/issues/84#issuecomment-1251323229

timsun28 commented 1 year ago

I've created a pr with a start for adding typescript tests to flowrouter. I don't have a lot of free time at the moment, so I haven't written many tests. But I hope others can extend from this initial test that I have written.

Happy to have helped and improved this nice package you have maintained!

dr-dimitru commented 6 months ago

Should be solved in the latest release Feel free to reopen it in case if the issue is still persists on your end.