Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
DonJayamanne committed Jan 22, 2024
1 parent a30c319 commit f14acda
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/kernels/raw/session/rawSessionConnection.node.unit.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,14 @@ import { ISignal, Signal } from '@lumino/signaling';
import * as sinon from 'sinon';
import { Kernel, KernelMessage, ServerConnection } from '@jupyterlab/services';
import { mock, when, instance, verify, anything } from 'ts-mockito';
import { CancellationError, CancellationTokenSource, Disposable, EventEmitter, Uri } from 'vscode';
import {
CancellationError,
CancellationTokenSource,
Disposable,
EventEmitter,
Uri,
WorkspaceConfiguration
} from 'vscode';
import { IJupyterKernelSpec, LocalKernelSpecConnectionMetadata } from '../../types';
import { noop } from '../../../test/core';
import { assert } from 'chai';
Expand All @@ -17,6 +24,7 @@ import { waitForCondition } from '../../../test/common';
import { KernelConnectionTimeoutError } from '../../errors/kernelConnectionTimeoutError';
import { RawSessionConnection } from './rawSessionConnection.node';
import { createDeferred } from '../../../platform/common/utils/async';
import { mockedVSCodeNamespaces } from '../../../test/vscode-mock';
const nonSerializingKernel =
require('@jupyterlab/services/lib/kernel/nonSerializingKernel') as typeof import('@jupyterlab/services/lib/kernel/default');

Expand Down Expand Up @@ -164,6 +172,9 @@ suite('Raw Session & Raw Kernel Connection', () => {
reason?: string | undefined;
}>();
nonSerializingKernel.KernelConnection = OldKernelConnectionClass;
const workspaceConfig = mock<WorkspaceConfiguration>();
when(workspaceConfig.get(anything(), anything())).thenCall((_, defaultValue) => defaultValue);
when(mockedVSCodeNamespaces.workspace.getConfiguration(anything())).thenReturn(instance(workspaceConfig));
token = new CancellationTokenSource();
disposables.push(token);
session = mock<RawSessionConnection>();
Expand Down

0 comments on commit f14acda

Please sign in to comment.