Notebook Extension: First logging improvements (#13729)

* First logging improvements

* PR feedback for err output
This commit is contained in:
Chris LaFreniere
2020-12-11 11:21:06 -08:00
committed by GitHub
parent 2df67c4f78
commit a5231ec0e5
12 changed files with 28 additions and 20 deletions

View File

@@ -13,13 +13,16 @@ import { PickPackagesPage } from '../../dialog/configurePython/pickPackagesPage'
import { python3DisplayName, allKernelsName } from '../../common/constants';
import { TestContext, createViewContext, TestButton } from '../common';
import { EventEmitter } from 'vscode';
import { MockOutputChannel } from '../common/stubs';
describe('Configure Python Wizard', function () {
let testWizard: ConfigurePythonWizard;
let viewContext: TestContext;
let testInstallation: JupyterServerInstallation;
let mockOutputChannel: TypeMoq.IMock<MockOutputChannel>;
beforeEach(() => {
mockOutputChannel = TypeMoq.Mock.ofType(MockOutputChannel);
let mockInstall = TypeMoq.Mock.ofType(JupyterServerInstallation);
mockInstall.setup(i => i.getInstalledPipPackages(TypeMoq.It.isAnyString())).returns(() => Promise.resolve([]));
mockInstall.setup(i => i.getRequiredPackagesForKernel(TypeMoq.It.isAnyString())).returns(() => [{ name: 'TestPkg', version: '1.0.0'}]);
@@ -41,21 +44,21 @@ describe('Configure Python Wizard', function () {
});
it('Start wizard test', async () => {
let wizard = new ConfigurePythonWizard(testInstallation);
let wizard = new ConfigurePythonWizard(testInstallation, mockOutputChannel.object);
await wizard.start();
await wizard.close();
await should(wizard.setupComplete).be.resolved();
});
it('Reject setup on cancel test', async () => {
let wizard = new ConfigurePythonWizard(testInstallation);
let wizard = new ConfigurePythonWizard(testInstallation, mockOutputChannel.object);
await wizard.start(undefined, true);
await wizard.close();
await should(wizard.setupComplete).be.rejected();
});
it('Error message test', async () => {
let wizard = new ConfigurePythonWizard(testInstallation);
let wizard = new ConfigurePythonWizard(testInstallation, mockOutputChannel.object);
await wizard.start();
should(wizard.wizard.message).be.undefined();