Skip to content

Commit 331b398

Browse files
committed
refactor(lint): enums and boolean undefineds
1 parent be6fbfb commit 331b398

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

src/commands/apex/run/test.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -234,18 +234,22 @@ const validateFlags = async (
234234
synchronous?: boolean,
235235
testLevel?: TestLevel
236236
): Promise<TestLevel> => {
237-
if (synchronous && (suiteNames || (classNames?.length && classNames.length > 1))) {
237+
if (synchronous && (Boolean(suiteNames) || (classNames?.length && classNames.length > 1))) {
238238
return Promise.reject(new Error(messages.getMessage('syncClassErr')));
239239
}
240240

241-
if ((tests || classNames || suiteNames) && testLevel && testLevel !== 'RunSpecifiedTests') {
241+
if (
242+
(Boolean(tests) || Boolean(classNames) || suiteNames) &&
243+
testLevel &&
244+
testLevel.toString() !== 'RunSpecifiedTests'
245+
) {
242246
return Promise.reject(new Error(messages.getMessage('testLevelErr')));
243247
}
244248

245249
if (testLevel) {
246250
return testLevel;
247251
}
248-
if (classNames || suiteNames || tests) {
252+
if (Boolean(classNames) || Boolean(suiteNames) || tests) {
249253
return TestLevel.RunSpecifiedTests;
250254
}
251255
return TestLevel.RunLocalTests;

src/reporters/testReporter.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ export class TestReporter {
6464
}
6565

6666
try {
67-
if (result.summary && result.summary.outcome === ApexTestRunResultStatus.Failed) {
67+
if (result.summary && result.summary.outcome === ApexTestRunResultStatus.Failed.toString()) {
6868
process.exitCode = FAILURE_EXIT_CODE;
6969
}
7070
switch (options['result-format']) {

0 commit comments

Comments
 (0)