我正嘗試使用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