Karma and RequireJS getting files outside base url

不想你离开。 提交于 2019-12-05 07:08:16

As you wrote it yourself

 // Karma serves files under /base, which is the basePath from your     config file
 baseUrl: '../',

So it means if you want to be able to access files deeper than that you need to shift all your url with a:

 baseUrl: '../..',

You could also use base/ which will be understood by karma as the basePath of your karmaConf.js

For a better understanding on how the basePath of karma.conf and test-main.js works you can have a look at this: http://monicalent.com/blog/2015/02/11/karma-tests-angular-js-require-j/

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!