knee-cola / jest-mock-axios

Axios mock for Jest
252 stars 42 forks source link

Fix TypeScript declarations for bundle #10

Closed eritikass closed 5 years ago

eritikass commented 6 years ago

When I try'ed to use this library in my TypeScript project I found out that while it's written in TypeScript and types even pointed out in package.json, npm bundle actually will not contain those. It seems that all this webpack+ts-loader+babel build system just lost those somewhere. Fix I made for this purpose is quite big (removing lot of logic), did go back for roots and used typescript compiler directly as its perfect for this kind of purposes (bundling for node).

This Pull Request also contains few more minor fixes for .npmignore (no test folder to bundle), adding types for jest and few typo fixes.

massa-man commented 6 years ago

Is there a plan to merge and release this fix? I am having the same issue... I would like to avoid having to manually write and add the definitions to my project, since @types/jest-mock-axios doesn't exist either

ktiedt commented 6 years ago

Also curious about this fix, as I just ran into this problem as well.

hugomn commented 5 years ago

Isn't this repo being maintained anymore? Is there any good fork with types working? Best

eritikass commented 5 years ago

@knee-cola

kingjan1999 commented 5 years ago

Isn't this repo being maintained anymore? Is there any good fork with types working? Best

Hi,

I've created kingjan1999/jest-mock-axios (published as @kingjan1999/jest-mock-axios on npm), which includes this and all other open pull requests from this repo (#12, #21, #22). Feel free to use it (there are several other forks on npm, I can't say how stable they are), I will try to maintain it.

knee-cola commented 5 years ago

I've stopped using Axios (replaced it with unfetch), so I don't plan to maintain this repo. @kingjan1999 let me know if you would like to take over this repo and NPM with it...

kingjan1999 commented 5 years ago

Thank you for the offer @knee-cola! I would be happy to help.

knee-cola commented 5 years ago

@kingjan1999 it's done! You now have a push access to the GitHub + publish access to NPM. I wish you happy coding!

P.S. Let me know if you have problems with access!

kingjan1999 commented 5 years ago

Works fine, thank you @knee-cola !

kingjan1999 commented 5 years ago

Hi,

Thank you so much for making an effort on this project @eritikass. As this mr addresses multiple issues, I'd like to split it. I've already implemented some changes with f305293. As soon as I publish the new version, the typescript declarations should be working.

For the change in the build system, I totally support moving away from webpack to tsc. However, I would like to postpone this a little further as it requires time to look into this.

kingjan1999 commented 5 years ago

Changes from this mr have been includes in f305293a5f9dc429a10254c7fab90d5cd454d90d and 5a3385d0fa288efd74eac25f7604b8d16b888a1b (it's a bit different than here, that's why I didn't simply merge). Consequently, I close this request. Thank you very much for your input!