Properly expose errors in ads and tests (#8692)

* add code to expose errors outside zone

* remove unexpect error hiding

* remove uncessary code

* fix tests

* trying to catch more errros

* revert for testing

* wip

* wip

* figured out what was going on

* wip

* fix tests

* fix tests
This commit is contained in:
Anthony Dresser
2019-12-17 12:06:36 -08:00
committed by GitHub
parent 6b5c31410d
commit ea5f9be441
29 changed files with 483 additions and 790 deletions

View File

@@ -19,6 +19,7 @@ import { UntitledTextEditorInput } from 'vs/workbench/common/editor/untitledText
import { SimpleUriLabelService } from 'vs/editor/standalone/browser/simpleServices';
import { IExtensionService, NullExtensionService } from 'vs/workbench/services/extensions/common/extensions';
import { INotebookService, IProviderInfo } from 'sql/workbench/services/notebook/browser/notebookService';
import { TestInstantiationService } from 'vs/platform/instantiation/test/common/instantiationServiceMock';
suite('Notebook Input', function (): void {
const instantiationService = workbenchInstantiationService();
@@ -41,6 +42,8 @@ suite('Notebook Input', function (): void {
}];
});
(instantiationService as TestInstantiationService).stub(INotebookService, mockNotebookService.object);
let untitledTextInput: UntitledTextEditorInput;
let untitledNotebookInput: UntitledNotebookInput;

View File

@@ -9,7 +9,6 @@ import * as assert from 'assert';
import { URI } from 'vs/base/common/uri';
import * as tempWrite from 'temp-write';
import { LocalContentManager } from 'sql/workbench/services/notebook/common/localContentManager';
import * as testUtils from '../../../../../base/test/common/async';
import { CellTypes } from 'sql/workbench/contrib/notebook/common/models/contracts';
import { TestInstantiationService } from 'vs/platform/instantiation/test/common/instantiationServiceMock';
import { TestFileService } from 'vs/workbench/test/workbenchTestServices';
@@ -73,7 +72,10 @@ suite('Local Content Manager', function (): void {
});
test('Should throw if file does not exist', async function (): Promise<void> {
await testUtils.assertThrowsAsync(async () => await contentManager.getNotebookContents(URI.file('/path/doesnot/exist.ipynb')), undefined);
try {
await contentManager.getNotebookContents(URI.file('/path/doesnot/exist.ipynb'));
assert.fail('expected to throw');
} catch (e) { }
});
test('Should return notebook contents parsed as INotebook when valid notebook file parsed', async function (): Promise<void> {
// Given a file containing a valid notebook