首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Meteor测试-未在分派下运行的客户端测试:mocha-phantomjs

Meteor测试-未在分派下运行的客户端测试:mocha-phantomjs
EN

Stack Overflow用户
提问于 2016-07-26 06:40:07
回答 1查看 467关注 0票数 2

我的测试是用mocha编写的,当我使用实际的meteor调用测试时,它们工作得很好,如下所示:

代码语言:javascript
复制
meteor test --full-app --driver-package practicalmeteor:mocha --port 4000 --settings test_settings.json

但是当我尝试使用dispatch:mocha-phantomjs时,只有服务器端测试运行:

代码语言:javascript
复制
meteor test --once --full-app --driver-package dispatch:mocha-phantomjs --settings test_settings.json

我是不是错过了什么关于meteor客户端和服务器分离的东西?

我正在尝试使用Travis for CI,因此我需要将测试切换到命令行输出,而不是浏览器

来自我的meteor/版本

代码语言:javascript
复制
dispatch:mocha-phantomjs@0.1.6
dispatch:phantomjs-tests@0.0.5
practicalmeteor:chai@2.1.0_1
practicalmeteor:loglevel@1.2.0_2
practicalmeteor:mocha@2.4.5_3
practicalmeteor:mocha-core@1.0.1
practicalmeteor:sinon@1.14.1_2

我正在使用practical meteor的2.4.5 rc3,因为当调度和practical meteor存在于同一个包文件中时出现了一个错误

谢谢!

EN

回答 1

Stack Overflow用户

发布于 2016-08-01 23:52:11

我最终使用spacejam/practicalmeteor:mocha-console-runner让我的客户端测试在travis中运行。我正在为任何感兴趣的人张贴我的.travis.yml。

代码语言:javascript
复制
sudo: true

language: node_js

before_install:
- npm install -g spacejam
- echo $METEOR_SETTINGS > test_settings.json
# assumes that meteor is not installed
# - curl https://install.meteor.com | /bin/sh
# if meteor has been properly cached
- sudo ln -s $HOME/.meteor/meteor /usr/local/bin/meteor

cache:
  directories:
    - node_modules
    - $HOME/.meteor/

before_script:
  - meteor npm install

script:
  - spacejam test --full-app --once --driver-package practicalmeteor:mocha-console-runner --settings test_settings.json
票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/38578478

复制
相关文章

相似问题

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