我的测试是用mocha编写的,当我使用实际的meteor调用测试时,它们工作得很好,如下所示:
meteor test --full-app --driver-package practicalmeteor:mocha --port 4000 --settings test_settings.json但是当我尝试使用dispatch:mocha-phantomjs时,只有服务器端测试运行:
meteor test --once --full-app --driver-package dispatch:mocha-phantomjs --settings test_settings.json我是不是错过了什么关于meteor客户端和服务器分离的东西?
我正在尝试使用Travis for CI,因此我需要将测试切换到命令行输出,而不是浏览器
来自我的meteor/版本
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存在于同一个包文件中时出现了一个错误
谢谢!
发布于 2016-08-01 23:52:11
我最终使用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.jsonhttps://stackoverflow.com/questions/38578478
复制相似问题