2017-02-10 24 views
1

当Wercker执行我的测试时,我总是收到这些错误。Wercker/PhantomJS在测试过程中一直在我的Ember项目中失败

not ok 1 PhantomJS 2.1 - Global error: SyntaxError: Unexpected token ')' at http://localhost:7357/assets/vendor.js, line 15740 
--- 
    Log: | 
     { type: 'error', 
      text: 'SyntaxError: Unexpected token \')\' at http://localhost:7357/assets/vendor.js, line 15740\n' } 
... 
not ok 2 PhantomJS 2.1 - Global error: Error: Could not find module ember-metal/core required by: ember-testing/index at http://localhost:7357/assets/test-support.js, line 62 
--- 
    Log: | 
     { type: 'error', 
      text: 'Error: Could not find module ember-metal/core required by: ember-testing/index at http://localhost:7357/assets/test-support.js, line 62\n' } 
... 
not ok 3 PhantomJS 2.1 - Global error: ReferenceError: Can't find variable: define at http://localhost:7357/assets/frontend.js, line 9 
--- 
    Log: | 
     { type: 'error', 
      text: 'ReferenceError: Can\'t find variable: define at http://localhost:7357/assets/frontend.js, line 9\n' } 
... 
not ok 4 PhantomJS 2.1 - Global error: ReferenceError: Can't find variable: define at http://localhost:7357/assets/tests.js, line 3 
--- 
    Log: | 
     { type: 'error', 
      text: 'ReferenceError: Can\'t find variable: define at http://localhost:7357/assets/tests.js, line 3\n' } 
... 
not ok 5 PhantomJS 2.1 - Global error: ReferenceError: Can't find variable: EmberENV at http://localhost:7357/5866/tests/index.html?hidepassed, line 44 
--- 
    Log: | 
     { type: 'error', 
      text: 'ReferenceError: Can\'t find variable: EmberENV at http://localhost:7357/5866/tests/index.html?hidepassed, line 44\n' } 
... 

当我通过使用运行我的测试在我的余烬项目中,测试通过。

烬测试

这只是在Wercker,它是该测试失败PhantomJS的使用。 我认为这有什么可做的,PhantomJS不支持ES6?但在我.jshintrc我加入这一行:

"esversion": 6, 

有没有办法让这些测试都通过了?


这些都是我的步骤wercker.yml:

steps: 
- script: 
    name: yarn-install 
    code: npm install -g yarn 

- script: 
    name: bower-install 
    code: yarn global add bower 

- script: 
    name: phantomjs-prebuilt-install 
    code: yarn global add phantomjs-prebuilt 

- script: 
    name: ember-cli 
    code: yarn global add ember-cli 

# A step that executes `npm install` command 
- script: 
    name: install-deps 
    code: yarn install 

- script: 
    name: bower-install-deps 
    code: bower install --allow-root 

- script: 
    name: tests 
    code: ember test 

- script: 
    name: ember-build 
    code: ember build 

回答

0

改变phantomjs版本1.9似乎解决了问题现在

- script: 
name: phantomjs-prebuilt-install 
code: yarn global add phantomjs-prebuilt 

到:

- script: 
name: phantomjs-prebuilt-install 
code: yarn global add [email protected] 
相关问题