我想测试我使用快递框架和MongoDB的特拉维斯CI创建的REST API服务。 测试本地作品在我的机器上,但未能上特拉维斯CI。 我猜问题是我.travis.yml和的package.json。
这里是我在本地运行我的测试:
// opens mongodb database on port 27017
mongod
// reads the db and returns documents depending on the request
node express.js
// test CRUD operations on the app
mocha express.test.js
我该怎么办上特拉维斯CI一样吗? 这里是我的应用程序https://github.com/mujuni88/Express-RestApi-Tutorial 。
travis.yml:
language: node_js
node_js:
- "0.10"
- "0.9"
services: mongodb
script:
- "./node_modules/mocha/bin/mocha *.test.js"
的package.json:
{
"name":"express-restapi",
"author":"Joe Buza",
"description":"Express RestApi",
"version": "0.0.1",
"private": true,
"keywords":["angular", "mocha", "mongodb", "express"],
"license":"BSD",
"dependencies": {
"express":"3.4.4",
"mongoskin":"0.6.0"
},
"devDependencies":{
"mocha":"1.13.0",
"expect.js":"0.2.0",
"superagent":"0.15.7"
},
"scripts":{
"start":"node express.js"
}
}