2016-07-25 35 views
1

我的测试中都写在摩卡和他们的工作很好,当我调用使用实际的流星,像这样的测试:流星测试 - 客户端的测试没有根据调度运行:摩卡phantomjs

meteor test --full-app --driver-package practicalmeteor:mocha --port 4000 --settings test_settings.json 

但是当我尝试使用调度:摩卡phantomjs,仅在服务器端运行测试:

meteor test --once --full-app --driver-package dispatch:mocha-phantomjs --settings test_settings.json 

我是不是失去了一些东西约流星客户端和服务器的分离?

我试图用特拉维斯CI的,所以我需要在命令行输出切换我的测试,而不是浏览器

从我的流星/版本

dispatch:[email protected] 
dispatch:[email protected] 
practicalmeteor:[email protected]_1 
practicalmeteor:[email protected]_2 
practicalmeteor:[email protected]_3 
practicalmeteor:[email protected] 
practicalmeteor:[email protected]_2 

我使用的是2.4。 5 rc3的实际流星,因为在调度和实际流星存在于同一个包文件中时出现一个错误

谢谢!

+0

你把你的测试文件放在哪里 – securecurve

回答

2

我最终使用了spacejam/practicalmeteor:mocha-console-runner来让我的客户端测试在travis中运行。我发布我的.travis.yml给任何感兴趣的人。

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