mirror of
https://github.com/strapi/strapi.git
synced 2026-01-06 04:03:25 +00:00
Fix tests
Signed-off-by: Convly <jean-sebastien.herbaux@epitech.eu>
This commit is contained in:
parent
823070df9d
commit
ecbe3bd1b0
@ -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;
|
||||
},
|
||||
|
||||
@ -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 => {
|
||||
|
||||
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user