Skip to content

Properly logs out user between tests #446

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 18, 2017
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
2 changes: 1 addition & 1 deletion integration/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"dependencies": {
"express": "^4.13.4",
"mocha": "^2.4.5",
"parse-server": "2.2.17"
"parse-server": "2.4.2"
},
"scripts": {
"test": "mocha --reporter dot -t 5000"
Expand Down
6 changes: 3 additions & 3 deletions integration/test/ParseGeoBoxTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ describe('Geo Box', () => {
Parse.CoreManager.set('SERVER_URL', 'http://localhost:1337/parse');
Parse.Storage._clear();
});

beforeEach((done) => {
beforeEach((done) => {
clear().then(() => {
done();
Parse.User.logOut().then(() => { done() }, () => { done() });
});
});

Expand Down
6 changes: 3 additions & 3 deletions integration/test/ParseGeoPointTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const TestObject = Parse.Object.extend('TestObject');
const TestPoint = Parse.Object.extend('TestPoint');

describe('Geo Point', () => {
before(() => {
before((done) => {
Parse.initialize('integration');
Parse.CoreManager.set('SERVER_URL', 'http://localhost:1337/parse');
Parse.Storage._clear();
Expand All @@ -28,8 +28,8 @@ describe('Geo Point', () => {

return Parse.Object.saveAll([sacramento, honolulu, sf]);
}).then(() => {
done();
});
return Parse.User.logOut();
}).then(() => { done() }, () => { done() });
});

it('can save geo points', (done) => {
Expand Down
4 changes: 2 additions & 2 deletions integration/test/ParseObjectTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -1183,8 +1183,8 @@ describe('Parse Object', () => {
}).then(() => {
assert.equal(user.createdAt.getTime(), sameUser.createdAt.getTime());
assert.equal(user.updatedAt.getTime(), sameUser.updatedAt.getTime());
done();
});
return Parse.User.logOut().then(() => { done(); }, () => { done(); });
}).catch(done.fail);
});

it('can fetchAllIfNeeded', (done) => {
Expand Down
9 changes: 7 additions & 2 deletions integration/test/ParseQueryTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ describe('Parse Query', () => {
}
return Parse.Object.saveAll(numbers);
}).then(() => {
done();
});
return Parse.User.logOut();
})
.then(() => { done() }, () => { done() });
});

it('can do basic queries', (done) => {
Expand Down Expand Up @@ -1182,6 +1183,10 @@ describe('Parse Query', () => {
assert(o.get('x') <= 15);
});
done();
})
.catch(err => {
console.dir(err);
done.fail();
});
});

Expand Down