加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

anglejs – 你如何用Karma Runner(又名Testacular)服务svg和fixt

发布时间:2020-12-17 07:47:57 所属栏目:安全 来源:网络整理
导读:过去两个小时,我一直在努力获得Karma的跑步者,以提供一个svg文件和一个html设备,但到目前为止还没有运气. 在这个线程上的第二个答案之后:Error while integrating html with testacularjs我一直在尝试使用服务来表示我的灯具和svg文件应该由服务器分发,但我
过去两个小时,我一直在努力获得Karma的跑步者,以提供一个svg文件和一个html设备,但到目前为止还没有运气.

在这个线程上的第二个答案之后:Error while integrating html with testacularjs我一直在尝试使用服务来表示我的灯具和svg文件应该由服务器分发,但我仍然得到’NOT FOUND’

files = [
  JASMINE,JASMINE_ADAPTER,REQUIRE,REQUIRE_ADAPTER,// put all components in requirejs 'paths' config here (included: false)
  { pattern: 'preview/public/components/**/*.js',included: false },{ pattern: 'preview/public/js/**/*.js',// assets
  { pattern: 'preview/public/img/svg/*.svg',included: false,served: true },// helpers & fixtures for jasmine-jquery
  { pattern: 'test/libs/**/*.js',included: true },{ pattern: 'test/fixtures/**/*.html',// all src and test modules (included: false)
  { pattern: 'test/specs/**/*.spec.js',// test main require module last
  'test/test-main.js'
];

我正在设置jasmine.getFixtures().fixturesPath到/ fixtures,我可以看到它正在使用正确的路径,但我仍然最终…

GET http:// localhost:9876 / img / svg / directional-pad-gradients.svg 404(未找到)
GET http:// localhost:9876 / fixtures / directional-pad.html 404(未找到)

如果任何人有一个加载灯具和/或svg与Karma赛跑者的例子,我真的很想看看.谢谢!

在这里回答我自己的问题

我正在尝试加载我的装置:http:// localhost:9876 / fixtures / directional-pad.html

相反,我应该尝试访问http:// localhost:9876 / base / test / fixtures / directional-pad.html

Karma将所有内容都存储在基础/路由下,因此您添加的任何静态文件路由都需要从此开始.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读