weixin_39782573
2020-12-09 07:18 阅读 0

Support for ImageData instantiation using a source array

This PR introduces changes in the ImageData class to comply with the official specification.

Changes

  • ImageData() now supports instantiation using the syntax: new ImageData(array, width [, height]);.
  • More semantic error types.
  • Test suite for the class was refactored, each inner describe block corresponds to each valid way to instantiate ImageData. All tests from the previous version are in the first inner describe block.

该提问来源于开源项目:hustcc/jest-canvas-mock

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享

7条回答 默认 最新

  • weixin_39629969 weixin_39629969 2020-12-09 07:18

    Coverage Status

    Coverage remained the same at 100.0% when pulling 44a1df8c7832aea796b1a3b9b01d57be6728c18a on lualparedes:master into 7d6239cf36fb3dc1d134e25175ff280ffddfca31 on hustcc:master.

    点赞 评论 复制链接分享
  • weixin_39629969 weixin_39629969 2020-12-09 07:18

    Coverage Status

    Coverage decreased (-0.07%) to 99.931% when pulling 27624eb8aa81e46d68b54398325ce706b6fe758b on lualparedes:master into 7d6239cf36fb3dc1d134e25175ff280ffddfca31 on hustcc:master.

    点赞 评论 复制链接分享
  • weixin_39838231 weixin_39838231 2020-12-09 07:18

    Wow. At first glance, this looks great and comprehensive. The test suite meets my expectations, and it appears to follow the specification.

    I will take some time to read the specs and go over the algorithms to look for some improvements, and inspect why coverage is reported at 99.931%. (Very strange.)

    点赞 评论 复制链接分享
  • weixin_39782573 weixin_39782573 2020-12-09 07:18

    Hi , thanks for replying quickly.

    The coverage issue was caused by a single line that wasn't covered because of a small typo in the test suite. The issue was fixed in the second commit.

    点赞 评论 复制链接分享
  • weixin_39703773 weixin_39703773 2020-12-09 07:18

    You can decide whether to merge the PR or not. And what is your npm id, you can help to release the new version.

    点赞 评论 复制链接分享
  • weixin_39838231 weixin_39838231 2020-12-09 07:18

    Thank you .

    I really like this pull request. Just want to give myself a little time with it to make sure everything is truly covered.

    The honest truth is it was a total oversight of mine not to have included it in the first place :)

    点赞 评论 复制链接分享
  • weixin_39838231 weixin_39838231 2020-12-09 07:18

    Alright! Looks good. I'm pretty confident this will be okay in production. It's just that this software was downloaded 88k times this week, and I wanted to sit on the pull request until I was absolutely confident it would be okay.

    we can release a minor update 2.2.0.

    Is it possible to get access to publish this on npm as well?

    npm id: jtenner

    点赞 评论 复制链接分享

相关推荐