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

karma配合ES6的问题 #37

Closed
lisleyang opened this issue Aug 31, 2017 · 3 comments
Closed

karma配合ES6的问题 #37

lisleyang opened this issue Aug 31, 2017 · 3 comments

Comments

@lisleyang
Copy link

lisleyang commented Aug 31, 2017

您好,一直把您的项目当作自己的一个教程,受益匪浅;
看到您最近添加了单元测试的内容,想了解下您是如何实现在断言中使用ES6语法,比如import之类的?

@baukh789
Copy link
Owner

baukh789 commented Aug 31, 2017

在断言里面不能使用import,可以使用require。
示例:

require('../src/js/GridManager').default;

@lisleyang
Copy link
Author

我说错了,不是断言,就是*.test.js文件中如何使用import引入需要测试的js文件,我在使用的时候一直在报import no defined

@baukh789
Copy link
Owner

你可以看一下这个项目中的使用方式,如果按同样方式报错的话。请检查你的依赖是否安装完整。
另外你如果想了解自动化测试,可以看一下我的jTool项目,相对于GridManager,jTool的自动化测试更全面一些。

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

2 participants