mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 02:51:36 -05:00
Fix hygiene/compile issues (release/1.26) (#14261)
* Fix hygiene issues * Fix strict compile * fixes * compile fix * more fixes * more compile fixes * last one?! * fix tests
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
*/
|
||||
export class Deferred<T> {
|
||||
promise: Promise<T>;
|
||||
resolve!: (value?: T | PromiseLike<T>) => void;
|
||||
resolve!: (value: T | PromiseLike<T>) => void;
|
||||
reject!: (reason?: any) => void;
|
||||
constructor() {
|
||||
this.promise = new Promise<T>((resolve, reject) => {
|
||||
|
||||
@@ -109,7 +109,7 @@ export function getDatabaseStateDisplayText(state: string): string {
|
||||
* @returns Promise resolving to the user's input if it passed validation,
|
||||
* or undefined if the input box was closed for any other reason
|
||||
*/
|
||||
async function promptInputBox(title: string, options: vscode.InputBoxOptions): Promise<string> {
|
||||
async function promptInputBox(title: string, options: vscode.InputBoxOptions): Promise<string | undefined> {
|
||||
const inputBox = vscode.window.createInputBox();
|
||||
inputBox.title = title;
|
||||
inputBox.prompt = options.prompt;
|
||||
|
||||
@@ -7,7 +7,7 @@ import { Deferred } from '../../common/promise';
|
||||
|
||||
describe('Deferred', () => {
|
||||
it('Then should be called upon resolution', function (done): void {
|
||||
const deferred = new Deferred();
|
||||
const deferred = new Deferred<void>();
|
||||
deferred.then(() => {
|
||||
done();
|
||||
});
|
||||
|
||||
@@ -29,7 +29,7 @@ describe('filePicker', function (): void {
|
||||
should(filePicker.filePathInputBox.value).should.not.be.undefined();
|
||||
filePicker.value!.should.equal(initialPath);
|
||||
filePicker.component().items.length.should.equal(2, 'Filepicker container should have two components');
|
||||
const deferred = new Deferred();
|
||||
const deferred = new Deferred<void>();
|
||||
sinon.stub(vscode.window, 'showOpenDialog').callsFake(async (_options) => {
|
||||
deferred.resolve();
|
||||
return [newFileUri];
|
||||
|
||||
Reference in New Issue
Block a user