diff --git a/extensions/typescript-language-features/src/test/unit/implicitProjectConfiguration.test.ts b/extensions/typescript-language-features/src/test/unit/implicitProjectConfiguration.test.ts deleted file mode 100644 index 28414c2b4a3..00000000000 --- a/extensions/typescript-language-features/src/test/unit/implicitProjectConfiguration.test.ts +++ /dev/null @@ -1,67 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -import * as assert from 'assert'; -import 'mocha'; -import { ImplicitProjectConfiguration } from '../../configuration/configuration'; - -suite('ImplicitProjectConfiguration', () => { - - test('should default strict to true', () => { - const mockConfiguration = { - get: (key: string, defaultValue?: T): T => { - // Return default values for all settings except when explicitly overridden - if (key === 'js/ts.implicitProjectConfig.strict') { - return (true as any) as T; - } - return defaultValue as T; - } - } as any; - - const config = new ImplicitProjectConfiguration(mockConfiguration); - assert.strictEqual(config.strict, true); - }); - - test('should respect user setting for strict', () => { - const mockConfiguration = { - get: (key: string, defaultValue?: T): T => { - if (key === 'js/ts.implicitProjectConfig.strict') { - return (false as any) as T; - } - return defaultValue as T; - } - } as any; - - const config = new ImplicitProjectConfiguration(mockConfiguration); - assert.strictEqual(config.strict, false); - }); - - test('should include strict in equality comparison', () => { - const mockConfigurationTrue = { - get: (key: string, defaultValue?: T): T => { - if (key === 'js/ts.implicitProjectConfig.strict') { - return (true as any) as T; - } - return defaultValue as T; - } - } as any; - - const mockConfigurationFalse = { - get: (key: string, defaultValue?: T): T => { - if (key === 'js/ts.implicitProjectConfig.strict') { - return (false as any) as T; - } - return defaultValue as T; - } - } as any; - - const configTrue1 = new ImplicitProjectConfiguration(mockConfigurationTrue); - const configTrue2 = new ImplicitProjectConfiguration(mockConfigurationTrue); - const configFalse = new ImplicitProjectConfiguration(mockConfigurationFalse); - - assert.strictEqual(configTrue1.isEqualTo(configTrue2), true); - assert.strictEqual(configTrue1.isEqualTo(configFalse), false); - }); -}); \ No newline at end of file diff --git a/extensions/typescript-language-features/src/test/unit/inferredProjectCompilerOptions.test.ts b/extensions/typescript-language-features/src/test/unit/inferredProjectCompilerOptions.test.ts deleted file mode 100644 index 8672fd37619..00000000000 --- a/extensions/typescript-language-features/src/test/unit/inferredProjectCompilerOptions.test.ts +++ /dev/null @@ -1,55 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -import * as assert from 'assert'; -import 'mocha'; -import { ImplicitProjectConfiguration } from '../../configuration/configuration'; -import { API } from '../../tsServer/api'; -import { inferredProjectCompilerOptions, ProjectType } from '../../tsconfig'; - -suite('inferredProjectCompilerOptions', () => { - - function createMockServiceConfig(strictValue: boolean) { - const mockConfiguration = { - get: (key: string, defaultValue?: T): T => { - if (key === 'js/ts.implicitProjectConfig.strict') { - return (strictValue as any) as T; - } - return defaultValue as T; - } - } as any; - - return { - implicitProjectConfiguration: new ImplicitProjectConfiguration(mockConfiguration) - } as any; - } - - test('should include strict: true when setting is enabled', () => { - const serviceConfig = createMockServiceConfig(true); - const version = API.fromVersionString('4.0.0'); - - const options = inferredProjectCompilerOptions(version, ProjectType.TypeScript, serviceConfig); - - assert.strictEqual(options.strict, true); - }); - - test('should not include strict when setting is disabled', () => { - const serviceConfig = createMockServiceConfig(false); - const version = API.fromVersionString('4.0.0'); - - const options = inferredProjectCompilerOptions(version, ProjectType.TypeScript, serviceConfig); - - assert.strictEqual(options.strict, undefined); - }); - - test('should work for JavaScript projects', () => { - const serviceConfig = createMockServiceConfig(true); - const version = API.fromVersionString('4.0.0'); - - const options = inferredProjectCompilerOptions(version, ProjectType.JavaScript, serviceConfig); - - assert.strictEqual(options.strict, true); - }); -}); \ No newline at end of file