Bumps minimum node engine to 8+ (#4474)

* Use node 8 as development environment

* fixup! Use node 8 as development environment

* bump node to 8.10

* Targets node 8 for everything

* Run npm install so lock file is up to date

* Use push adapter v3

* Deflake a test on ParseUser

* Adds slight delay after logout

* Ensure we wait even if call fails

* Use node carbon
This commit is contained in:
Florent Vilmart
2018-05-18 15:49:00 -04:00
committed by GitHub
parent 77ed10f57b
commit a619119684
8 changed files with 12941 additions and 16 deletions

View File

@@ -3580,14 +3580,18 @@ describe('Parse.User testing', () => {
email: 'yo@lo.com'
}).then(() => {
const token = user.getSessionToken();
const promises = [];
while(promises.length != 5) {
promises.push(Parse.User.logIn('yolo', 'yolo').then((res) => {
// ensure a new session token is generated at each login
expect(res.getSessionToken()).not.toBe(token);
}));
let promise = Promise.resolve();
let count = 0;
while(count < 5) {
promise = promise.then(() => {
return Parse.User.logIn('yolo', 'yolo').then((res) => {
// ensure a new session token is generated at each login
expect(res.getSessionToken()).not.toBe(token);
});
});
count++;
}
return Promise.all(promises);
return promise;
}).then(() => {
// wait because session destruction is not synchronous
return new Promise((resolve) => {

View File

@@ -217,7 +217,14 @@ afterEach(function(done) {
});
})
.then(() => Parse.User.logOut())
.then(afterLogOut, afterLogOut)
.then(() => {}, () => {}) // swallow errors
.then(() => {
// Connection close events are not immediate on node 10+... wait a bit
return new Promise((resolve) => {
setTimeout(resolve, 0);
});
})
.then(afterLogOut)
});
const TestObject = Parse.Object.extend({