Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
coverage
dist
lib
logs
node_modules
test_output
*~
Expand Down
17 changes: 16 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,25 @@
---
language: node_js
node_js:
- 'iojs'
- '5'

branches:
only:
- master

env:
- CXX=g++-4.8

services: mongodb

addons:
apt:
sources:
- mongodb-3.0-precise
- ubuntu-toolchain-r-test
packages:
- mongodb-org-server
- g++-4.8

script: npm test && ./run_integration.sh
after_script: cat ./coverage/coverage-final.json | ./node_modules/codecov.io/bin/codecov.io.js && rm -rf ./coverage
3 changes: 3 additions & 0 deletions integration/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## Integration tests

These tests run against a local instance of `parse-server`
11 changes: 11 additions & 0 deletions integration/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"private": true,
"dependencies": {
"express": "^4.13.4",
"mocha": "^2.4.5",
"parse-server": "^2.1.1"
},
"scripts": {
"test": "mocha --reporter dot -t 5000"
}
}
31 changes: 31 additions & 0 deletions integration/server.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
var express = require('express');
var ParseServer = require('parse-server').ParseServer;
var app = express();

// Specify the connection string for your mongodb database
// and the location to your Parse cloud code
var api = new ParseServer({
databaseURI: 'mongodb://localhost:27017/integration',
appId: 'integration',
masterKey: 'notsosecret',
serverURL: 'http://localhost:1337/parse' // Don't forget to change to https if needed
});

// Serve the Parse API on the /parse URL prefix
app.use('/parse', api);

const DatabaseAdapter = require('parse-server/lib/DatabaseAdapter');

app.get('/clear', (req, res) => {
var promises = [];
for (var conn in DatabaseAdapter.dbConnections) {
promises.push(DatabaseAdapter.dbConnections[conn].deleteEverything());
}
Promise.all(promises).then(() => {
res.send('{}');
});
});

app.listen(1337, () => {
console.log('parse-server running on port 1337.');
});
Loading