Skip to content
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

jest cannot set property '0' of undefined #15

Closed
BTCLTC opened this issue Jan 29, 2019 · 0 comments
Closed

jest cannot set property '0' of undefined #15

BTCLTC opened this issue Jan 29, 2019 · 0 comments

Comments

@BTCLTC
Copy link

BTCLTC commented Jan 29, 2019

TypeError: Cannot set property '0' of undefined
at Object.qrToImageData (/node_modules/_@chenfengyuan_vue-qrcode@1.0.0@@chenfengyuan/vue-qrcode/dist/vue-qrcode.common.js:2679:25)

在使用Jest做单元测试时,采用了jest-canvas-mock来模拟canvas,结果在vue-qrcode.common.js的2679行代码报错,打印出来的imgData为undefined,所以代码报错。

@BTCLTC BTCLTC closed this as completed Feb 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant