我正尝试使用Ember测试集成自动化测试。EmberJS运行测试时出现全局错误
该应用程序在浏览器上正常运行,没有任何错误。我尝试了简单的运行
ember test
在命令行上,但得到一堆全局错误,所有的测试都失败了。
这是我得到的错误:
not ok 1 PhantomJS 2.1 - Global error: SyntaxError: Unexpected token ',' at http://localhost:4302/assets/vendor.js, line 145617
not ok 2 PhantomJS 2.1 - Global error: Error: Could not find module ember-metal/core required by: ember-testing/index at http://localhost:4302/assets/test-support.js, line 62
not ok 3 PhantomJS 2.1 - Global error: ReferenceError: Can't find variable: define at http://localhost:4302/assets/tests.js, line 1
...
当我运行在浏览器上测试,我没有得到语法错误(上述第一个),第一个错误是
Uncaught Error: Could not find module `analogue/resolver` imported from `analogue/tests/helpers/resolver`
这些对我来说没有意义,因为我不应该编辑vendor.js和它说找不到的模块。有任何想法吗?
您使用的是什么版本的烬? – dustinfarris
是否安装了所有[先决条件](https://ember-cli.com/user-guide/#prerequisites)?主要phantomjs –
你有没有试过用'-s'标志在浏览器中运行测试并查看浏览器控制台?有时有错误,很容易理解有 – GUL