我正在尝试将单元测试添加到过去两年开发并定期更新到最新 ember 版本的现有项目中。
为此,我首先运行
$ ember test -s
version: 1.13.13
Building...
Build successful - 11946ms.
该过程已启动,但随后 Web 浏览器打开,我在浏览器窗口中收到以下错误消息:
Not found: /7596/tests/index.html?hidepassed
数字会发生变化,但我可以删除它以获得相同的结果。访问/
只是重定向到/tests/index.html?hidepassed
,结果相同。
这是输出curl
:
$ curl -i http://localhost:7357/tests/index.html?hidepassed
HTTP/1.1 404 Not Found
X-Powered-By: Express
Cache-Control: No-cache
Pragma: No-cache
Content-Type: text/html; charset=utf-8
Content-Length: 39
ETag: W/"27-KHWxXB+A/SkhyzCtPXoJ4Q"
Date: Wed, 02 Dec 2015 16:41:22 GMT
Connection: keep-alive
Not found: /tests/index.html?hidepassed
当单元测试服务器未运行时,端口被关闭,因此它似乎是正确的 Web 服务器,而不是我系统上的其他东西。
当我使用 ember-cli 创建一个新项目时,测试页面可以正常工作。我已经比较了tests
目录 、testem.json
和中的所有文件ember-cli-build.js
,但我找不到任何可能导致此问题的差异。bower.json
package.json
有没有人知道我可以寻找什么来使它与我现有的项目一起工作?
我正在运行 ember 2.2.0 和 ember-cli 1.13.13。如果有任何区别,则 ember 项目通常运行通过ember-cli-rails-addon
.