Skip to content

Commit

Permalink
Stub dvc config calls in integration tests (#3777)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattseddon authored Apr 28, 2023
1 parent bb842d0 commit 3b1c372
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions extension/src/test/suite/extension.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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('.')

Expand Down
4 changes: 4 additions & 0 deletions extension/src/test/suite/setup/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export const buildSetup = (
messageSpy,
resourceLocator,
internalCommands,
dvcExecutor,
dvcReader,
gitExecutor,
gitReader
Expand Down Expand Up @@ -78,6 +79,8 @@ export const buildSetup = (
})
)

stub(dvcExecutor, 'config').resolves('')

const setup = disposer.track(
new Setup(
config,
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 3b1c372

Please sign in to comment.