tests: enable nock when needed

by default, it makes all requests disappear
This commit is contained in:
Girish Ramakrishnan
2025-02-05 18:19:00 +01:00
parent 7bcb6dd7cb
commit aa54e47029
6 changed files with 8 additions and 0 deletions

View File

@@ -212,6 +212,7 @@ function createTree(root, obj) {
}
async function databaseSetup() {
if (nock.isActive()) nock.restore();
nock.cleanAll();
await database.initialize();
@@ -221,6 +222,7 @@ async function databaseSetup() {
}
async function domainSetup() {
if (nock.isActive()) nock.restore();
nock.cleanAll();
await databaseSetup();
@@ -242,6 +244,7 @@ async function setup() {
}
async function cleanup() {
if (nock.isActive()) nock.restore();
nock.cleanAll();
mailer._mailQueue = [];