Skip to content

Commit 9d39870

Browse files
authored
Fix warnings produced by integration tests (#3728)
1 parent d9bbeef commit 9d39870

File tree

3 files changed

+18
-10
lines changed

3 files changed

+18
-10
lines changed

extension/src/test/suite/experiments/data/index.test.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,9 @@ suite('Experiments Data Test Suite', () => {
9898
disposable.track(new EventEmitter<boolean>()),
9999
{
100100
getIsBranchesView: () => false,
101-
getNbOfCommitsToShow: () => DEFAULT_NUM_OF_COMMITS_TO_SHOW
102-
} as ExperimentsModel
101+
getNbOfCommitsToShow: () => DEFAULT_NUM_OF_COMMITS_TO_SHOW,
102+
setAvailableBranchesToShow: stub()
103+
} as unknown as ExperimentsModel
103104
)
104105
)
105106

@@ -151,8 +152,9 @@ suite('Experiments Data Test Suite', () => {
151152
disposable.track(new EventEmitter<boolean>()),
152153
{
153154
getIsBranchesView: () => false,
154-
getNbOfCommitsToShow: () => DEFAULT_NUM_OF_COMMITS_TO_SHOW
155-
} as ExperimentsModel
155+
getNbOfCommitsToShow: () => DEFAULT_NUM_OF_COMMITS_TO_SHOW,
156+
setAvailableBranchesToShow: stub()
157+
} as unknown as ExperimentsModel
156158
)
157159
)
158160

extension/src/test/suite/experiments/util.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,8 +200,9 @@ export const buildExperimentsData = (disposer: SafeWatcherDisposer) => {
200200
disposer.track(new EventEmitter<boolean>()),
201201
{
202202
getIsBranchesView: () => false,
203-
getNbOfCommitsToShow: () => DEFAULT_NUM_OF_COMMITS_TO_SHOW
204-
} as ExperimentsModel
203+
getNbOfCommitsToShow: () => DEFAULT_NUM_OF_COMMITS_TO_SHOW,
204+
setAvailableBranchesToShow: stub()
205+
} as unknown as ExperimentsModel
205206
)
206207
)
207208

extension/src/test/suite/vscode/walkthrough.test.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { afterEach, beforeEach, describe, it, suite } from 'mocha'
22
import { expect } from 'chai'
33
import { commands } from 'vscode'
4-
import { restore, spy } from 'sinon'
4+
import { restore, stub } from 'sinon'
55
import { closeAllEditors } from '../util'
66
import { RegisteredCommands } from '../../../commands/external'
77

@@ -16,14 +16,19 @@ suite('Walkthrough Test Suite', () => {
1616

1717
describe('dvc.getStarted', () => {
1818
it('should be able to show the walkthrough', async () => {
19-
const executeCommandSpy = spy(commands, 'executeCommand')
19+
const mockExecuteCommand = stub(commands, 'executeCommand')
20+
mockExecuteCommand
21+
.onFirstCall()
22+
.callsFake((...args) => mockExecuteCommand.wrappedMethod(...args))
23+
.onSecondCall()
24+
.resolves(undefined)
2025

2126
await expect(
2227
commands.executeCommand(RegisteredCommands.EXTENSION_GET_STARTED)
2328
).to.be.eventually.equal(undefined)
2429

25-
expect(executeCommandSpy).to.be.calledTwice
26-
expect(executeCommandSpy).to.be.calledWith(
30+
expect(mockExecuteCommand).to.be.calledTwice
31+
expect(mockExecuteCommand).to.be.calledWith(
2732
'workbench.action.openWalkthrough',
2833
'iterative.dvc#welcome'
2934
)

0 commit comments

Comments
 (0)