Add more folders to strict compile (#8954)

* add more folders to strictire compile, add more strict compile options

* update ci

* remove unnecessary assertion
This commit is contained in:
Anthony Dresser
2020-01-27 16:26:49 -08:00
committed by GitHub
parent fefe1454de
commit 64929de09d
81 changed files with 630 additions and 644 deletions

View File

@@ -31,11 +31,11 @@ let connectionProfile: IConnectionProfile = {
groupFullName: 'g2/g2-2',
groupId: 'group id',
getOptionsKey: () => 'connection1',
matches: undefined,
matches: undefined!,
providerName: mssqlProviderName,
options: {},
saveProfile: true,
id: undefined
id: undefined!
};
let editorConnectionProfile: IConnectionProfile = {
connectionName: 'new name',
@@ -48,11 +48,11 @@ let editorConnectionProfile: IConnectionProfile = {
groupFullName: 'g2/g2-2',
groupId: 'group id',
getOptionsKey: () => 'connection2',
matches: undefined,
matches: undefined!,
providerName: mssqlProviderName,
options: {},
saveProfile: true,
id: undefined
id: undefined!
};
let connectionProfileWithoutDbName: IConnectionProfile = {
connectionName: 'new name',
@@ -65,11 +65,11 @@ let connectionProfileWithoutDbName: IConnectionProfile = {
groupFullName: 'g2/g2-2',
groupId: 'group id',
getOptionsKey: () => 'connection1',
matches: undefined,
matches: undefined!,
providerName: mssqlProviderName,
options: {},
saveProfile: true,
id: undefined
id: undefined!
};
let connection1Id: string;
@@ -101,7 +101,7 @@ suite('SQL ConnectionStatusManager tests', () => {
test('findConnection should return connection given valid id', () => {
let id: string = connection1Id;
let actual = connections.findConnection(id);
assert.equal(connectionProfileObject.matches(actual.connectionProfile), true);
assert.equal(connectionProfileObject.matches(actual!.connectionProfile), true);
});
test('getConnectionProfile should return undefined given invalid id', () => {
@@ -114,7 +114,7 @@ suite('SQL ConnectionStatusManager tests', () => {
test('getConnectionProfile should return connection given valid id', () => {
let id: string = connection1Id;
let actual = connections.getConnectionProfile(id);
assert.equal(connectionProfileObject.matches(actual), true);
assert.equal(connectionProfileObject.matches(actual!), true);
});
test('hasConnection should return false given invalid id', () => {
@@ -136,11 +136,11 @@ suite('SQL ConnectionStatusManager tests', () => {
let summary: azdata.ConnectionInfoSummary = {
ownerUri: connection1Id,
connectionId: connection1Id,
messages: undefined,
errorMessage: undefined,
errorNumber: undefined,
serverInfo: undefined,
connectionSummary: undefined
messages: undefined!,
errorMessage: undefined!,
errorNumber: undefined!,
serverInfo: undefined!,
connectionSummary: undefined!
};
connections.onConnectionComplete(summary);
let actual = connections.addConnection(connectionProfile, connection1Id).connecting;
@@ -152,14 +152,14 @@ suite('SQL ConnectionStatusManager tests', () => {
let summary: azdata.ConnectionInfoSummary = {
ownerUri: connection1Id,
connectionId: connection1Id,
messages: undefined,
errorMessage: undefined,
errorNumber: undefined,
serverInfo: undefined,
connectionSummary: undefined
messages: undefined!,
errorMessage: undefined!,
errorNumber: undefined!,
serverInfo: undefined!,
connectionSummary: undefined!
};
connections.onConnectionComplete(summary);
let actual = connections.findConnection(connection1Id).connecting;
let actual = connections.findConnection(connection1Id)!.connecting;
assert.equal(actual, expected);
actual = connections.isConnecting(connection1Id);
assert.equal(actual, expected);
@@ -174,8 +174,8 @@ suite('SQL ConnectionStatusManager tests', () => {
let actualId = connections.updateConnectionProfile(updatedConnection, connection1Id);
let newId = Utils.generateUri(updatedConnection);
let actual = connections.getConnectionProfile(newId).groupId;
let actualConnectionId = connections.getConnectionProfile(newId).id;
let actual = connections.getConnectionProfile(newId)!.groupId;
let actualConnectionId = connections.getConnectionProfile(newId)!.id;
assert.equal(actual, expected);
assert.equal(actualId, newId);
assert.equal(actualConnectionId, expectedConnectionId);
@@ -186,25 +186,25 @@ suite('SQL ConnectionStatusManager tests', () => {
let summary: azdata.ConnectionInfoSummary = {
connectionSummary: {
databaseName: dbName,
serverName: undefined,
userName: undefined
serverName: undefined!,
userName: undefined!
}
, ownerUri: connection3Id,
connectionId: 'connection id',
errorMessage: undefined,
errorNumber: undefined,
messages: undefined,
serverInfo: undefined
errorMessage: undefined!,
errorNumber: undefined!,
messages: undefined!,
serverInfo: undefined!
};
//The original connection didn't have database name
let connectionStatus = connections.findConnection(connection3Id);
connectionStatus.connectionProfile.databaseName = '';
connectionStatus!.connectionProfile.databaseName = '';
//Verify database name changed after connection is complete
connections.updateDatabaseName(summary);
connectionStatus = connections.findConnection(connection3Id);
assert.equal(connectionStatus.connectionProfile.databaseName, dbName);
assert.equal(connectionStatus!.connectionProfile.databaseName, dbName);
});
test('getOriginalOwnerUri should return the original uri given uri with db name', () => {
@@ -212,24 +212,24 @@ suite('SQL ConnectionStatusManager tests', () => {
let summary: azdata.ConnectionInfoSummary = {
connectionSummary: {
databaseName: dbName,
serverName: undefined,
userName: undefined
serverName: undefined!,
userName: undefined!
}
, ownerUri: connection3Id,
connectionId: 'connection id',
errorMessage: undefined,
errorNumber: undefined,
messages: undefined,
serverInfo: undefined
errorMessage: undefined!,
errorNumber: undefined!,
messages: undefined!,
serverInfo: undefined!
};
//The original connection didn't have database name
let connectionStatus = connections.findConnection(connection3Id);
let connectionStatus = connections.findConnection(connection3Id)!;
connectionStatus.connectionProfile.databaseName = '';
//Verify database name changed after connection is complete
connections.updateDatabaseName(summary);
connectionStatus = connections.findConnection(connection3Id);
connectionStatus = connections.findConnection(connection3Id)!;
let ownerUriWithDbName = Utils.generateUriWithPrefix(connectionStatus.connectionProfile, 'connection:');
//The uri assigned to connection without db name should be the original one