EmberJS common error while running tests

I am trying to integrate automated testing using Ember Testing.

The application works fine in the browser without any errors. I tried just running

ember test

on the command line, but get a bunch of global errors and all tests fail.

These are the errors I get:

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 in the browser, I do not get a syntax error (first above), the first error

Uncaught Error: Could not find module `analogue/resolver` imported from `analogue/tests/helpers/resolver`

This does not make sense to me, since I do not need to edit vendor.js, and there are modules that, according to him, they cannot find. Any ideas?

+4
source share
2 answers

, - ( ) .

SyntaxError ( '(' '!'). .

, 2.1 1.9

npm install -g phantomjs@1.9.20

( nvm nave, )

+3

PhantomJS

npm uninstall phantomjs -g
npm install phantomjs -g
0

Source: https://habr.com/ru/post/1648563/


All Articles