From 3b1c3722c201eb53570ac0918d670ae3b1e559be Mon Sep 17 00:00:00 2001 From: Matt Seddon <37993418+mattseddon@users.noreply.github.com> Date: Sat, 29 Apr 2023 08:34:22 +1000 Subject: [PATCH] Stub dvc config calls in integration tests (#3777) --- extension/src/test/suite/extension.test.ts | 1 + extension/src/test/suite/setup/util.ts | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/extension/src/test/suite/extension.test.ts b/extension/src/test/suite/extension.test.ts index 3aff799f9f..8da48a2167 100644 --- a/extension/src/test/suite/extension.test.ts +++ b/extension/src/test/suite/extension.test.ts @@ -94,6 +94,7 @@ suite('Extension Test Suite', () => { const mockExpShow = stub(DvcReader.prototype, 'expShow') const mockDataStatus = stub(DvcReader.prototype, 'dataStatus') const mockPlotsDiff = stub(DvcReader.prototype, 'plotsDiff') + stub(DvcExecutor.prototype, 'config').resolves('') stub(DvcReader.prototype, 'root').resolves('.') diff --git a/extension/src/test/suite/setup/util.ts b/extension/src/test/suite/setup/util.ts index c0be6298fc..64c73a2544 100644 --- a/extension/src/test/suite/setup/util.ts +++ b/extension/src/test/suite/setup/util.ts @@ -33,6 +33,7 @@ export const buildSetup = ( messageSpy, resourceLocator, internalCommands, + dvcExecutor, dvcReader, gitExecutor, gitReader @@ -78,6 +79,8 @@ export const buildSetup = ( }) ) + stub(dvcExecutor, 'config').resolves('') + const setup = disposer.track( new Setup( config, @@ -118,6 +121,7 @@ export const buildSetup = ( export const buildSetupWithWatchers = async (disposer: Disposer) => { const mockEmitter = disposer.track(new EventEmitter()) const mockInternalCommands = { + executeCommand: stub(), registerExternalCliCommand: stub(), registerExternalCommand: stub() } as unknown as InternalCommands