Fix tests

Signed-off-by: Convly <jean-sebastien.herbaux@epitech.eu>
This commit is contained in:
Convly 2020-11-30 14:23:03 +01:00
parent 823070df9d
commit ecbe3bd1b0
4 changed files with 7 additions and 7 deletions

View File

@ -147,7 +147,7 @@ module.exports = {
return ctx.badRequest('ValidationError', err);
}
strapi.admin.services.auth.forgotPassword(input);
await strapi.admin.services.auth.forgotPassword(input);
ctx.status = 204;
},

View File

@ -184,7 +184,7 @@ const deleteByIds = async (ids = []) => {
};
/** Count the number of users for some roles
* @returns {Promise<integer>}
* @returns {Promise<number>}
* @param roleId
*/
const getUsersCount = async roleId => {

View File

@ -202,7 +202,7 @@ module.exports = function(strapi) {
for (const connName of mongooseConnections) {
const connection = strapi.connections[connName];
if (connection instanceof Mongoose) {
if (connection instanceof Mongoose && connection.connection.readyState === 1) {
connection.disconnect();
}
}

View File

@ -205,10 +205,6 @@ class Strapi {
this.server.destroy();
}
if (_.has(this, 'db')) {
await this.db.destroy();
}
if (_.has(this, 'plugins.graphql')) {
await this.plugins.graphql.destroy();
}
@ -219,6 +215,10 @@ class Strapi {
this.eventHub.removeAllListeners();
if (_.has(this, 'db')) {
await this.db.destroy();
}
delete global.strapi;
}