首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Wercker/PhantomJS一直在测试中失败我的Ember项目

Wercker/PhantomJS一直在测试中失败我的Ember项目
EN

Stack Overflow用户
提问于 2017-02-10 08:40:25
回答 1查看 326关注 0票数 1

在Wercker执行测试时,我一直收到这些错误。

代码语言:javascript
复制
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?有关,但是在my .jshintrc中,我添加了以下一行:

代码语言:javascript
复制
"esversion": 6,

有办法让这些测试通过吗?

以下是我在wercker.yml中的步骤:

代码语言:javascript
复制
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
EN

回答 1

Stack Overflow用户

发布于 2017-02-20 07:44:36

将幻影版本改为1.9似乎解决了目前的问题

代码语言:javascript
复制
- script:
 name: phantomjs-prebuilt-install
 code: yarn global add phantomjs-prebuilt

至:

代码语言:javascript
复制
- script:
 name: phantomjs-prebuilt-install
 code: yarn global add phantomjs@1.9
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/42154917

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档