Skip to content

Commit

Permalink
test fix
Browse files Browse the repository at this point in the history
  • Loading branch information
sadasant committed Jun 17, 2022
1 parent ed73fa3 commit 4fbfc65
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/test/datascience/data-viewing/dataViewer.unit.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
'use strict';

import { anything, instance, mock, verify, when } from 'ts-mockito';
import { ConfigurationChangeEvent, EventEmitter } from 'vscode';
import { ConfigurationChangeEvent, EventEmitter, Uri } from 'vscode';
import { ApplicationShell } from '../../../platform/common/application/applicationShell';
import {
IApplicationShell,
Expand Down Expand Up @@ -39,14 +39,16 @@ suite('DataScience - DataViewer', () => {
dataProvider = mock(JupyterVariableDataProvider);
const settings = mock(JupyterSettings);
const settingsChangedEvent = new EventEmitter<void>();
const context: IExtensionContext = mock<IExtensionContext>();

when(settings.onDidChange).thenReturn(settingsChangedEvent.event);
when(configService.getSettings(anything())).thenReturn(instance(settings));

const configChangeEvent = new EventEmitter<ConfigurationChangeEvent>();
when(workspaceService.onDidChangeConfiguration).thenReturn(configChangeEvent.event);

when(workspaceService.onDidChangeConfiguration).thenReturn(configChangeEvent.event);
when(dataProvider.getDataFrameInfo(anything(), anything())).thenResolve({});
when(context.extensionUri).thenReturn(Uri.parse('/'));

dataViewer = new DataViewer(
instance(webPanelProvider),
Expand All @@ -55,7 +57,7 @@ suite('DataScience - DataViewer', () => {
instance(applicationShell),
new MockMemento(),
instance(mock<IDataScienceErrorHandler>()),
instance(mock<IExtensionContext>())
instance(context)
);
});
test('Data viewer showData calls gets dataFrame info from data provider', async () => {
Expand Down

0 comments on commit 4fbfc65

Please sign in to comment.