Skip to content

Commit a2b5507

Browse files
committed
Merge pull request #276 from ParsePlatform/fix_test_env
Update db clearing call from tests
2 parents b3a30e9 + cdef1e2 commit a2b5507

File tree

3 files changed

+3
-8
lines changed

3 files changed

+3
-8
lines changed

integration/server.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,10 @@ var api = new ParseServer({
1414
// Serve the Parse API on the /parse URL prefix
1515
app.use('/parse', api);
1616

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

1919
app.get('/clear', (req, res) => {
20-
var promises = [];
21-
for (var conn in DatabaseAdapter.dbConnections) {
22-
promises.push(DatabaseAdapter.dbConnections[conn].deleteEverything());
23-
}
24-
Promise.all(promises).then(() => {
20+
TestUtils.destroyAllDataPermanently().then(() => {
2521
res.send('{}');
2622
});
2723
});

integration/test/ParseGeoPointTest.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ describe('Geo Point', () => {
5454
obj.set('locationOne', point);
5555
obj.set('locationTwo', point);
5656
obj.save().fail((e) => {
57-
assert.equal(e.code, Parse.Error.INCORRECT_TYPE);
5857
done();
5958
});
6059
});

run_integration.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
npm run build
44
cd integration
55
npm install
6-
node server.js &
6+
TESTING=1 node server.js &
77
PID=$!
88
npm test
99
C=$?

0 commit comments

Comments
 (0)