-
Notifications
You must be signed in to change notification settings - Fork 142
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
TypeScript: Improve Definition #238
Comments
Any improvements are appreciated. Hey @duluca, you'd suggested helping out with our typescript story, want to look at this? |
Updated OP with the link to the fork and branch. |
PR #239 |
Will review. @sgtoj please lmk if there's anything specific I can help with. I'll leave any comments re: code on the pr |
Disclaimer: I am not the best when it comes to communication so there may be the grammar mistakes or typos. I did a quick proof reading before committing. The jsdoc comments probably could use some additions or improvements from someone who has more experience with the framework and/or understanding behind the abstractions. Otherwise, it should be ready. |
Sounds good. Will give it a shake tonight. |
Sorry to jump in, but with published typings I'm getting an error in VSCode (Typescript 2.3): const myMock = td.object(['run', 'search']);
td.when(myMock.run()).thenCallback(null);
// Error: Property 'run' does not exist on type 'DoubledObjectWithKey<"run" | "search">'. Is it something this PR is going to solve? Or are you guys not getting this? |
@albertogasparin I suggest you attempt checking out the branch in #239 to find out for yourself |
Yep, was doing it. In fact, I'm still getting the same error even with the PR typings. Unfortunately I don't have much experience with Typescript, so I'm unable propose a fix |
@albertogasparin I will look in to this issue. Hopefully, I will find a fix, add a test, and submit a new PR. |
I fixed the issue and added a new TS test in #239. @albertogasparin @searls |
Good to hear. I'm chatting with @duluca tomorrow and want to have a chat with him about our TS approach more broadly before merging |
Any updates on this? |
Let me know if there is anything I forgot to do or address. |
@duluca I believe we are ready. |
Close, but no cigar. The test code must live in the regression/test.ts file. |
List of improvements I believe is needed for the TypeScript definition. I have already started working on this list. Love to hear feedback if you have any.
td.func()
td.function()
andtd.func()
td.constructor()
./test/src/typescript/test.ts
to reflect any additions.Changes: sgtoj/testdouble.js:improve-ts
The text was updated successfully, but these errors were encountered: