test: enable nock as needed

This commit is contained in:
Girish Ramakrishnan
2025-02-06 15:01:59 +01:00
parent f64297c256
commit c6e93b9870
4 changed files with 21 additions and 6 deletions

View File

@@ -13,6 +13,7 @@ const child_process = require('child_process'),
constants = require('../constants.js'),
dockerProxy = require('../dockerproxy.js'),
expect = require('expect.js'),
nock = require('nock'),
syslogServer = require('../../syslog.js');
const DOCKER = `docker -H tcp://172.18.0.1:${constants.DOCKER_PROXY_PORT} `;
@@ -35,6 +36,7 @@ describe('Dockerproxy', function () {
// create a container to test against
before(async function () {
if (nock.isActive()) nock.restore(); // required to connect to the docker socket
await setup();
await syslogServer.start();
await dockerProxy.start();