jeudi 24 mars 2016

Ember.js tests failure due to PhantomJS syntax error

I'm getting this error when running my tests in an Ember application. Apparently there's a syntax error (Unexpected token ',') that is occurring in a way that makes the very loading of the test environment fail, therefore it consequently makes every single test fails.

$ ember test
version: 1.13.13
Built project successfully. Stored in "/Users/ernesto/code/projects/my-app/frontend/tmp/class-tests_dist-cqvfx9XF.tmp".
not ok 1 PhantomJS 2.0 - global failure
    ---
        actual: >
            null
        message: >
            SyntaxError: Unexpected token ','
        Log: |
    ...
not ok 2 PhantomJS 2.0 - global failure
    ---
        actual: >
            null
        message: >
            Error: Could not find module `frontend/config/environment` imported from `frontend/tests/helpers/resolver`
        Log: |
    ...
not ok 3 PhantomJS 2.0 - global failure
    ---
        actual: >
            null
        message: >
            Error: Assertion Failed: The tests file was not loaded. Make sure your tests index.html includes "assets/tests.js".
        Log: |
    ...
not ok 4 PhantomJS 2.0 - Integration | Component | dropdown filter: it renders all given options and the empty option
    ---
        actual: >
            null
        message: >
            Promise rejected before it renders all given options and the empty option: you must set a resolver with `testResolver.set(resolver)`
        Log: |
    ...

Notice the first error above, that says global failure and then reports the unexpected comma token. After that, all remaining tests fail, either because they cannot import a file that exists, or because the testResolver is not set, or something else.

The thing is everything runs correctly in the browser. It appears that this has to do with PhantomJS being more strict with some syntax somewhere. But there's no indication in the error message about where this rogue comma is located.

Can someone give me some hints about how to find this comma or solve this error somehow? Thanks in advance.




Aucun commentaire:

Enregistrer un commentaire