I am trying to integrate automated testing using Ember Testing.
The application runs fine on browser, without any errors. I tried simply running
ember test
on command line, but get a bunch of global errors and all the tests fail.
These are the errors I'm getting:
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
...
When I run the tests on the browser, I do not get the syntax error (first one above), the first error is
Uncaught Error: Could not find module `analogue/resolver` imported from `analogue/tests/helpers/resolver`
These don't make sense to me since I shouldn't be editing vendor.js and the modules it says it cannot find are there. Any ideas?
In case anyone else (like me) ends up here with a similar problem.
In my case the list of errors always started with a random SyntaxError (sometimes about '(' or '!'). The actual referenced line usually never even contained these symbols.
The solution for me was to downgrade phantomjs from 2.1 to a 1.9 version
npm install -g [email protected]
(use nvm
or nave
to make your life easier in these cases)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With