Skip to content

Commit 1eb4538

Browse files
eslint
1 parent 56494ec commit 1eb4538

File tree

3 files changed

+11
-10
lines changed

3 files changed

+11
-10
lines changed

.eslintignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,6 @@ src/test/testing/navigation/suiteNavigator.unit.test.ts
135135
src/test/testing/navigation/commandHandlers.unit.test.ts
136136
src/test/testing/navigation/helper.unit.test.ts
137137
src/test/testing/navigation/symbolNavigator.unit.test.ts
138-
src/test/testing/configuration.unit.test.ts
139138
src/test/testing/explorer/treeView.unit.test.ts
140139
src/test/testing/explorer/testExplorerCommandHandler.unit.test.ts
141140
src/test/testing/explorer/failedTestHandler.unit.test.ts

src/client/testing/configuration/index.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ import {
1919
UnitTestProduct,
2020
} from '../common/types';
2121

22+
export const NONE_SELECTED = Error('none selected');
23+
2224
@injectable()
2325
export class UnitTestConfigurationService implements ITestConfigurationService {
2426
private readonly configurationService: IConfigurationService;
@@ -51,7 +53,7 @@ export class UnitTestConfigurationService implements ITestConfigurationService {
5153
option,
5254
);
5355
if (item !== option) {
54-
throw Error();
56+
throw NONE_SELECTED;
5557
}
5658
return this._promptToEnableAndConfigureTestFramework(wkspace);
5759
}
@@ -127,7 +129,7 @@ export class UnitTestConfigurationService implements ITestConfigurationService {
127129
try {
128130
const selectedTestRunner = await this.selectTestRunner(messageToDisplay);
129131
if (typeof selectedTestRunner !== 'number') {
130-
throw Error();
132+
throw NONE_SELECTED;
131133
}
132134
const helper = this.serviceContainer.get<ITestsHelper>(ITestsHelper);
133135
telemetryProps.tool = helper.parseProviderName(selectedTestRunner);

src/test/testing/configuration.unit.test.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import {
2121
} from '../../client/testing/common/types';
2222
import { TEST_OUTPUT_CHANNEL } from '../../client/testing/constants';
2323
import { ITestingSettings } from '../../client/testing/configuration/types';
24-
import { UnitTestConfigurationService } from '../../client/testing/configuration';
24+
import { NONE_SELECTED, UnitTestConfigurationService } from '../../client/testing/configuration';
2525

2626
suite('Unit Tests - ConfigurationService', () => {
2727
UNIT_TEST_PRODUCTS.forEach((product) => {
@@ -263,7 +263,7 @@ suite('Unit Tests - ConfigurationService', () => {
263263
try {
264264
await testConfigService.target.displayTestFrameworkError(workspaceUri);
265265
} catch (exc) {
266-
if (exc !== null) {
266+
if (exc !== NONE_SELECTED) {
267267
throw exc;
268268
}
269269
exceptionThrown = true;
@@ -294,7 +294,7 @@ suite('Unit Tests - ConfigurationService', () => {
294294
});
295295
await testConfigService.target.displayTestFrameworkError(workspaceUri);
296296
} catch (exc) {
297-
if (exc !== null) {
297+
if (exc !== NONE_SELECTED) {
298298
throw exc;
299299
}
300300
exceptionThrown = true;
@@ -333,7 +333,7 @@ suite('Unit Tests - ConfigurationService', () => {
333333
.setup((t) => t.selectTestRunner(typeMoq.It.isAny()))
334334
.returns(() => {
335335
selectTestRunnerInvoked = true;
336-
return Promise.resolve(product as any);
336+
return Promise.resolve(product);
337337
});
338338

339339
const configMgr = typeMoq.Mock.ofType<ITestConfigurationManager>(
@@ -382,7 +382,7 @@ suite('Unit Tests - ConfigurationService', () => {
382382
try {
383383
await testConfigService.target.displayTestFrameworkError(workspaceUri);
384384
} catch (exc) {
385-
if (exc !== null) {
385+
if (exc !== NONE_SELECTED) {
386386
throw exc;
387387
}
388388
exceptionThrown = true;
@@ -407,7 +407,7 @@ suite('Unit Tests - ConfigurationService', () => {
407407
.setup((t) => t.selectTestRunner(typeMoq.It.isAny()))
408408
.returns(() => {
409409
selectTestRunnerInvoked = true;
410-
return Promise.resolve(product as any);
410+
return Promise.resolve(product);
411411
});
412412

413413
let enableTestInvoked = false;
@@ -475,7 +475,7 @@ suite('Unit Tests - ConfigurationService', () => {
475475
.setup((t) => t.selectTestRunner(typeMoq.It.isAny()))
476476
.returns(() => {
477477
selectTestRunnerInvoked = true;
478-
return Promise.resolve(product as any);
478+
return Promise.resolve(product);
479479
});
480480

481481
const configMgr = typeMoq.Mock.ofType<ITestConfigurationManager>();

0 commit comments

Comments
 (0)