Skip to content

Commit

Permalink
Merge pull request #276 from ParsePlatform/fix_test_env
Browse files Browse the repository at this point in the history
Update db clearing call from tests
  • Loading branch information
andrewimm committed May 12, 2016
2 parents b3a30e9 + cdef1e2 commit a2b5507
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 8 deletions.
8 changes: 2 additions & 6 deletions integration/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,10 @@ var api = new ParseServer({
// Serve the Parse API on the /parse URL prefix
app.use('/parse', api);

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

app.get('/clear', (req, res) => {
var promises = [];
for (var conn in DatabaseAdapter.dbConnections) {
promises.push(DatabaseAdapter.dbConnections[conn].deleteEverything());
}
Promise.all(promises).then(() => {
TestUtils.destroyAllDataPermanently().then(() => {
res.send('{}');
});
});
Expand Down
1 change: 0 additions & 1 deletion integration/test/ParseGeoPointTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ describe('Geo Point', () => {
obj.set('locationOne', point);
obj.set('locationTwo', point);
obj.save().fail((e) => {
assert.equal(e.code, Parse.Error.INCORRECT_TYPE);
done();
});
});
Expand Down
2 changes: 1 addition & 1 deletion run_integration.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
npm run build
cd integration
npm install
node server.js &
TESTING=1 node server.js &
PID=$!
npm test
C=$?
Expand Down

0 comments on commit a2b5507

Please sign in to comment.