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,7 +19,6 @@ import { TestConnectionManagementService } from 'sql/platform/connection/test/co
import { ICommandService } from 'vs/platform/commands/common/commands';
import { TestCommandService } from 'vs/editor/test/browser/editorTestServices';
import { IConnectionProfile } from 'sql/platform/connection/common/interfaces';
import { assertThrowsAsync } from 'sql/base/test/common/async';
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
import { ILogService, NullLogService } from 'vs/platform/log/common/log';
import { TestConfigurationService } from 'vs/platform/configuration/test/common/testConfigurationService';
@@ -139,7 +138,7 @@ suite('commandLineService tests', () => {
return configurationService;
}
test('processCommandLine shows connection dialog by default', done => {
test('processCommandLine shows connection dialog by default', () => {
const connectionManagementService: TypeMoq.Mock<IConnectionManagementService>
= TypeMoq.Mock.ofType<IConnectionManagementService>(TestConnectionManagementService, TypeMoq.MockBehavior.Strict);
@@ -152,10 +151,9 @@ suite('commandLineService tests', () => {
.verifiable(TypeMoq.Times.never());
const configurationService = getConfigurationServiceMock(true);
let contribution = getCommandLineContribution(connectionManagementService.object, configurationService.object);
contribution.processCommandLine(new TestParsedArgs()).then(() => {
return contribution.processCommandLine(new TestParsedArgs()).then(() => {
connectionManagementService.verifyAll();
done();
}, error => { assert.fail(error, null, 'processCommandLine rejected ' + error); done(); });
}, error => { assert.fail(error, null, 'processCommandLine rejected ' + error); });
});
test('processCommandLine does nothing if no server name and command name is provided and the configuration \'workbench.showConnectDialogOnStartup\' is set to false, even if registered servers exist', async () => {
@@ -295,7 +293,10 @@ suite('commandLineService tests', () => {
.verifiable(TypeMoq.Times.once());
const configurationService = getConfigurationServiceMock(true);
let contribution = getCommandLineContribution(connectionManagementService.object, configurationService.object, capabilitiesService, commandService.object);
assertThrowsAsync(async () => await contribution.processCommandLine(args));
try {
await contribution.processCommandLine(args);
assert.fail('expected to throw');
} catch (e) { }
});
test('processCommandLine uses Integrated auth if no user name or auth type is passed', async () => {