-
Notifications
You must be signed in to change notification settings - Fork 73
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
Fix attachment type (#175) #184
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you very much for the fix!
Please make the CI green first, then I'll be able to add some improvements on it under the protection of the unit tests.
tests/puppeteer-attachment.spec.ts
Outdated
const mockedResUploadMedia = { | ||
MediaId: 'MediaId', | ||
} | ||
const getExtName = (filename: string) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why we re-define this function, instead of using the puppet.getExtName()
for testing?
tests/puppeteer-attachment.spec.ts
Outdated
const getExtName = (filename: string) => { | ||
return extname(filename).slice(1) | ||
} | ||
const extToType = (ext: string): WebMessageType => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why we re-define this function, instead of using the puppet.extToType()
for testing?
I think we should test those methods on the puppet
, please remove the defines in the tests, and use the existing code in puppet instead.
This PR will be ready to be merged after we finished improving testing codes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK,I just want to prevent extToType
and getExtName
from being accidentally modified
It is not a best practice for using I have pushed some modifications in this PR and has just been overwritten by your force push. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please let me know when you believe this PR is ready to be merged, and I'll add some comments to the code then merge it.
Thank you very much for all efforts for fixing and improving the puppet wechat, appreciate it!
Sorry, I am merging commits to make diff clearer. |
Thanks for your advice and help.
Probably puppet-wechat/src/puppet-wechat.ts Lines 1348 to 1352 in 1442099
|
Thank you very much for sending this PR for fixing the attachments sending bug! The code will be published on |
Fix #175
ref #178
Sorry about that, #178 cannot be opened again.