Skip to content

Commit f6bccf5

Browse files
fixed test lint issues (#1035)
Signed-off-by: msivasubramaniaan <[email protected]>
1 parent 588b2da commit f6bccf5

7 files changed

+13
-13
lines changed

test/autoCompletion.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ import {
1212
TestCustomSchemaProvider,
1313
toFsPath,
1414
} from './utils/testHelper';
15-
import assert = require('assert');
16-
import path = require('path');
15+
import * as assert from 'assert';
16+
import * as path from 'path';
1717
import { createExpectedCompletion } from './utils/verifyError';
1818
import { ServiceSetup } from './utils/serviceSetup';
1919
import { CompletionList, InsertTextFormat, MarkupContent, MarkupKind, Position } from 'vscode-languageserver-types';

test/defaultSnippets.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
* Licensed under the MIT License. See License.txt in the project root for license information.
44
*--------------------------------------------------------------------------------------------*/
55
import { toFsPath, setupSchemaIDTextDocument, setupLanguageService, caretPosition } from './utils/testHelper';
6-
import assert = require('assert');
7-
import path = require('path');
6+
import * as assert from 'assert';
7+
import * as path from 'path';
88
import { ServiceSetup } from './utils/serviceSetup';
99
import { LanguageHandlers } from '../src/languageserver/handlers/languageHandlers';
1010
import { SettingsState, TextDocumentTestManager } from '../src/yamlSettings';

test/documentSymbols.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {
99
createExpectedDocumentSymbolNoDetail,
1010
} from './utils/verifyError';
1111
import { DocumentSymbol, SymbolKind, SymbolInformation } from 'vscode-languageserver-types';
12-
import assert = require('assert');
12+
import * as assert from 'assert';
1313
import { ServiceSetup } from './utils/serviceSetup';
1414
import { SettingsState, TextDocumentTestManager } from '../src/yamlSettings';
1515
import { LanguageHandlers } from '../src/languageserver/handlers/languageHandlers';

test/findLinks.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Licensed under the MIT License. See License.txt in the project root for license information.
44
*--------------------------------------------------------------------------------------------*/
55
import { setupLanguageService, setupTextDocument } from './utils/testHelper';
6-
import assert = require('assert');
6+
import * as assert from 'assert';
77
import { ServiceSetup } from './utils/serviceSetup';
88
import { DocumentLink } from 'vscode-languageserver-types';
99
import { SettingsState, TextDocumentTestManager } from '../src/yamlSettings';

test/jsonParser.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ describe('JSON Parser', () => {
5252

5353
function assertObject(node: ASTNode, expectedProperties: string[]): void {
5454
assert.equal(node.type, 'object');
55-
assert.equal((<ObjectASTNode>node).properties.length, expectedProperties.length);
56-
const keyList = (<ObjectASTNode>node).properties.map((p) => p.keyNode.value);
55+
assert.equal((node as ObjectASTNode).properties.length, expectedProperties.length);
56+
const keyList = (node as ObjectASTNode).properties.map((p) => p.keyNode.value);
5757
assert.deepEqual(keyList, expectedProperties);
5858
}
5959

@@ -1708,7 +1708,7 @@ describe('JSON Parser', () => {
17081708
function parse<T>(v: string): T {
17091709
const { jsonDoc } = toDocument(v);
17101710
assert.equal(jsonDoc.syntaxErrors.length, 0);
1711-
return <T>getNodeValue(jsonDoc.root);
1711+
return getNodeValue(jsonDoc.root) as T;
17121712
}
17131713

17141714
let value = parse<{ far: string }>('// comment\n{\n"far": "boo"\n}');

test/schema.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import * as parser from '../src/languageservice/parser/yamlParser07';
33
import * as SchemaService from '../src/languageservice/services/yamlSchemaService';
44
import * as JsonSchema from '../src/languageservice/jsonSchema';
55
import * as url from 'url';
6-
import path = require('path');
6+
import * as path from 'path';
77
import { XHRResponse, xhr } from 'request-light';
88
import { MODIFICATION_ACTIONS, SchemaDeletions } from '../src/languageservice/services/yamlSchemaService';
99
import { KUBERNETES_SCHEMA_URL } from '../src/languageservice/utils/schemaUrls';

test/schemaRequestHandler.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ describe('Schema Request Handler Tests', () => {
2828
sandbox.restore();
2929
});
3030
it('Should care Win URI', async () => {
31-
const connection = <Connection>{};
31+
const connection = {} as Connection;
3232
const resultPromise = schemaRequestHandler(
3333
connection,
3434
'c:\\some\\window\\path\\scheme.json',
@@ -43,14 +43,14 @@ describe('Schema Request Handler Tests', () => {
4343
});
4444

4545
it('UNIX URI should works', async () => {
46-
const connection = <Connection>{};
46+
const connection = {} as Connection;
4747
const resultPromise = schemaRequestHandler(connection, '/some/unix/path/', [], URI.parse(''), false, testFileSystem);
4848
const result = await resultPromise;
4949
expect(result).to.be.equal('{some: "json"}');
5050
});
5151

5252
it('should handle not valid Windows path', async () => {
53-
const connection = <Connection>{};
53+
const connection = {} as Connection;
5454
const resultPromise = schemaRequestHandler(
5555
connection,
5656
'A:/some/window/path/scheme.json',

0 commit comments

Comments
 (0)