Open sgtoj opened 7 years ago
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
@sgtoj Worked like a charm, thanks! Hope to see #239 merged soon 😉
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.
@sgtoj as noted on PR #239, there are a couple of tasks due: TODO: [ ] Update from master, resolve conflicts [ ] Update PR and make sure CI checks pass
@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