我将Karma (v0.12.37)与JSPM (v0.16.2)一起用作测试运行程序。我在 karma 中添加了以下代理配置,以便正确加载 JSPM 文件:
proxies: {
'/base/jspm_packages/': '/base/app/jspm_packages/'
}
但是这行不通,并且在以下情况下失败:
PhantomJS 2.0.0 (Windows 8 0.0.0) ERROR: 'Potentially unhandled rejection [10] Error: XHR error loading http://localhost:9876/base/jspm_packages/npm/babel-core@5.8.22.js
Error loading http://localhost:9876/base/jspm_packages/npm/babel-core@5.8.22.js
Error loading http://localhost:9876/base/app/pages/examples/todo-example/todo.controller.test.js'
调试日志给出:
proxying request - /base/jspm_packages/npm/babel-core@5.8.22.js to localhost:9876
/base/app/jspm_packages/npm/babel-core@5.8.22.js { host: 'localhost',
port: 9876,
baseProxyUrl: '/base/app/jspm_packages/',
https: false }
但是以下包含“app”的网址可以正常工作:
http://localhost : 9876/base/app/jspm_packages/npm/babel-core@5.8.22.js
关于出了什么问题的任何线索?