admin管理员组文章数量:1356735
After updating to the latest version of Aurelia (March update beta.1.1.4), I'm getting the following error every time I run karma tests:
Error: Reflect.getOwnMetadata is not a function
Error loading C:/Software/myproject/test/unit/myclass.spec.ts
How do I fix it?
After updating to the latest version of Aurelia (March update beta.1.1.4), I'm getting the following error every time I run karma tests:
Error: Reflect.getOwnMetadata is not a function
Error loading C:/Software/myproject/test/unit/myclass.spec.ts
How do I fix it?
Share Improve this question edited Mar 3, 2016 at 19:16 Mikhail Shilkov asked Mar 3, 2016 at 14:42 Mikhail ShilkovMikhail Shilkov 35.2k4 gold badges76 silver badges110 bronze badges1 Answer
Reset to default 12This has to do with the change of Aurelia from core-js
to home-grown polyfills. The Reflect polyfill is missing and tests fail to run.
This problem is addressed in Aurelia navigation skeleton app by the following import statement in each unit test file:
import 'aurelia-polyfills';
I solved it by creating a setup.ts
(or setup.js
resp. to your language) file with just this statement, and then just listing it in karma.config.js
at the first place.
for JS e.g.:
jspm : {
loadFiles: ['test/unit/setup.js', 'test/unit/**/*.js'],
...
}
for Typescript e.g.:
files: ['test/unit/setup.ts', 'test/unit/**/*.ts'],
...
本文标签: javascriptReflectgetOwnMetadata is not a function in karma with latest AureliaStack Overflow
版权声明:本文标题:javascript - Reflect.getOwnMetadata is not a function in karma with latest Aurelia - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1743988442a2571694.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论