From 511bb05cb987d605f377d97fa4424facb0e14841 Mon Sep 17 00:00:00 2001 From: Pagan Gazzard Date: Tue, 11 Aug 2020 16:05:28 +0100 Subject: [PATCH] Tests: Use a tmp data dir to avoid conflicts/overwriting existing data Change-type: patch --- tests/config-tests.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/config-tests.ts b/tests/config-tests.ts index 1d7cce7e..b1ba56a4 100644 --- a/tests/config-tests.ts +++ b/tests/config-tests.ts @@ -15,6 +15,11 @@ * limitations under the License. */ +import * as tmp from 'tmp'; +tmp.setGracefulCleanup(); +// Use a temporary dir for tests data +process.env.BALENARC_DATA_DIRECTORY = tmp.dirSync().name; + import { EventEmitter } from 'events'; EventEmitter.defaultMaxListeners = 35; // it appears that 'nock' adds a bunch of listeners - bug? // SL: Looks like it's not nock causing this, as have seen the problem triggered from help.spec,