Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stub dvc config calls in integration tests #3777

Merged
merged 1 commit into from
Apr 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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