2016-11-21 171 views
0

基本文件夹结构,我app.spec.js文件 enter image description here角茉莉花单元测试

我的内部文件夹结构:

this is my folder structure

卡姆拉配置文件: 我已经给出了正确的路径karma.config.js中的angularjs文件,但仍显示angularjs未定义。 这里有什么可能的问题和解决方案。

this is my config file

错误,我越来越:

this error I'm getting

所有答案:)欢迎

+0

删除./并尝试 – rrd

+0

@rrd:我试过了,但是仍然得到同样的错误:( – UniCoder

+0

使用绝对路径尝试 – Matheno

回答

0

谢谢大家你的回应。

此问题已解决。 主要原因是,我在我的index.html页面和karma.config.js文件中指的是angularjs文件的不同版本。 我试着用同一版本的文件,它解决了这个问题。

如果您正在获得angular is not defined error,请参考相同版本的文件。例如就像您为angularjs提供V 1.5.5一样,请在karma.config.js中提供相同版本的文件引用。