Remove unit tests as requested in PR feedback

Co-authored-by: mjbvz <12821956+mjbvz@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2025-08-14 16:44:43 +00:00
parent 822232673f
commit 5f1c49b2e4
2 changed files with 0 additions and 122 deletions

View File

@@ -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: <T>(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: <T>(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: <T>(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: <T>(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);
});
});

View File

@@ -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: <T>(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);
});
});