Remove unnecessary awaits from extensions (#19571)

* Remove unnecessary awaits

* fix ignore

* revert eslintignore

* try

* increase size

* Increase sql lint size
This commit is contained in:
Charles Gagnon
2022-05-31 15:36:44 -07:00
committed by GitHub
parent 96f345a74a
commit 6ae380b65d
65 changed files with 179 additions and 100 deletions

View File

@@ -159,95 +159,95 @@ describe('Utils Tests', function () {
it('Constraints have no version specifier', async function (): Promise<void> {
let pythonVersion = '3.6';
let versionConstraints = ['3.6.*', '3.*'];
let result = await utils.isPackageSupported(pythonVersion, versionConstraints);
let result = utils.isPackageSupported(pythonVersion, versionConstraints);
should(result).be.true();
versionConstraints = ['3.5.*', '3.5'];
result = await utils.isPackageSupported(pythonVersion, versionConstraints);
result = utils.isPackageSupported(pythonVersion, versionConstraints);
should(result).be.false();
});
it('Package is valid for version constraints', async function (): Promise<void> {
let pythonVersion = '3.6';
let versionConstraints = ['>=3.5,!=3.2,!=3.4.*'];
let result = await utils.isPackageSupported(pythonVersion, versionConstraints);
let result = utils.isPackageSupported(pythonVersion, versionConstraints);
should(result).be.true();
});
it('Version constraints string has lots of spaces', async function (): Promise<void> {
let pythonVersion = '3.6';
let versionConstraints = ['>= 3.5, != 3.2, != 3.4.*'];
let result = await utils.isPackageSupported(pythonVersion, versionConstraints);
let result = utils.isPackageSupported(pythonVersion, versionConstraints);
should(result).be.true();
});
it('Strictly greater or less than comparisons', async function (): Promise<void> {
let pythonVersion = '3.6';
let versionConstraints = ['> 3.5, > 3.4.*', '< 3.8'];
let result = await utils.isPackageSupported(pythonVersion, versionConstraints);
let result = utils.isPackageSupported(pythonVersion, versionConstraints);
should(result).be.true();
});
it('Strict equality', async function (): Promise<void> {
let pythonVersion = '3.6';
let versionConstraints = ['== 3.6', '== 3.6.*'];
let result = await utils.isPackageSupported(pythonVersion, versionConstraints);
let result = utils.isPackageSupported(pythonVersion, versionConstraints);
should(result).be.true();
});
it('Package is valid for first set of constraints, but not the second', async function (): Promise<void> {
let pythonVersion = '3.6';
let versionConstraints = ['>=3.5, !=3.2, !=3.4.*', '!=3.6, >=3.5'];
let result = await utils.isPackageSupported(pythonVersion, versionConstraints);
let result = utils.isPackageSupported(pythonVersion, versionConstraints);
should(result).be.true();
});
it('Package is valid for second set of constraints, but not the first', async function (): Promise<void> {
let pythonVersion = '3.6';
let versionConstraints = ['!=3.6, >=3.5', '>=3.5, !=3.2, !=3.4.*'];
let result = await utils.isPackageSupported(pythonVersion, versionConstraints);
let result = utils.isPackageSupported(pythonVersion, versionConstraints);
should(result).be.true();
});
it('Package is not valid for constraints', async function (): Promise<void> {
let pythonVersion = '3.6';
let versionConstraints = ['>=3.4, !=3.6, >=3.5'];
let result = await utils.isPackageSupported(pythonVersion, versionConstraints);
let result = utils.isPackageSupported(pythonVersion, versionConstraints);
should(result).be.false();
});
it('Package is not valid for several sets of constraints', async function (): Promise<void> {
let pythonVersion = '3.6';
let versionConstraints = ['>=3.7', '!=3.6, >=3.5', '>=3.8'];
let result = await utils.isPackageSupported(pythonVersion, versionConstraints);
let result = utils.isPackageSupported(pythonVersion, versionConstraints);
should(result).be.false();
});
it('Constraints are all empty strings', async function (): Promise<void> {
let pythonVersion = '3.6';
let versionConstraints = ['', '', ''];
let result = await utils.isPackageSupported(pythonVersion, versionConstraints);
let result = utils.isPackageSupported(pythonVersion, versionConstraints);
should(result).be.true();
});
it('Constraints are all undefined', async function (): Promise<void> {
let pythonVersion = '3.6';
let versionConstraints: string[] = [undefined, undefined, undefined];
let result = await utils.isPackageSupported(pythonVersion, versionConstraints);
let result = utils.isPackageSupported(pythonVersion, versionConstraints);
should(result).be.true();
});
it('Constraints are a bunch of commas', async function (): Promise<void> {
let pythonVersion = '3.6';
let versionConstraints: string[] = [',,,', ',,,,', ', , , , , , ,'];
let result = await utils.isPackageSupported(pythonVersion, versionConstraints);
let result = utils.isPackageSupported(pythonVersion, versionConstraints);
should(result).be.true();
});
it('Installed python version is an empty string', async function (): Promise<void> {
let pythonVersion = '';
let versionConstraints = ['>=3.7', '!=3.6, >=3.5', '>=3.8'];
let result = await utils.isPackageSupported(pythonVersion, versionConstraints);
let result = utils.isPackageSupported(pythonVersion, versionConstraints);
should(result).be.true();
});
});