对CI(circleCI)上的mongo DB执行测试失败,即使它们在本地传递。
安装mongo db并将应用程序连接到db,这是我的circle.yml文件
machine:
node:
version: 7.2.1
dependencies:
override:
- sudo apt-get purge mongodb-org*
- sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
- echo "deb http://repo.mongodb.org/apt/ubuntu precise/mongodb-org/3.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.0.list
- sudo apt-get update
- sudo apt-get install -y mongodb-org
- sudo service mongod restart
- npm install
test:
override:
- npm run test
数据库网址:mongodb://mongodb:27017/db-name
答案 0 :(得分:0)
为此编辑你的circle.yml:
machine:
node:
version: 7.2.1
dependencies:
override:
- npm install
test:
override:
- npm run test