Skip to content

Commit

Permalink
add to existing integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
mattseddon committed Jan 25, 2023
1 parent 86029d3 commit 4b738ae
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion extension/src/test/suite/extension.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ import { WorkspaceExperiments } from '../../experiments/workspace'
import { GitReader } from '../../cli/git/reader'
import { MIN_CLI_VERSION } from '../../cli/dvc/contract'
import { ConfigKey, setConfigValue } from '../../vscode/config'
import { DvcExecutor } from '../../cli/dvc/executor'
import { dvcDemoPath } from '../util'
import { Setup } from '../../setup'
import { Flag } from '../../cli/dvc/constants'

suite('Extension Test Suite', () => {
const disposable = Disposable.fn()
Expand Down Expand Up @@ -241,11 +245,17 @@ suite('Extension Test Suite', () => {
})

describe('dvc.stopAllRunningExperiments', () => {
it('should send a telemetry event containing properties relating to the event', async () => {
it.only('should send a telemetry event containing properties relating to the event', async () => {
const duration = 1234
const otherRoot = resolve('other', 'root')
mockDuration(duration)

const mockSendTelemetryEvent = stub(Telemetry, 'sendTelemetryEvent')
const mockQueueStop = stub(DvcExecutor.prototype, 'queueStop').resolves(
undefined
)

stub(Setup.prototype, 'getRoots').returns([dvcDemoPath, otherRoot])

await commands.executeCommand(RegisteredCommands.STOP_EXPERIMENTS)

Expand All @@ -259,6 +269,9 @@ suite('Extension Test Suite', () => {
duration
}
)

expect(mockQueueStop).to.be.calledWith(dvcDemoPath, Flag.KILL)
expect(mockQueueStop).to.be.calledWith(otherRoot, Flag.KILL)
})
})

Expand Down

0 comments on commit 4b738ae

Please sign in to comment.