@@ -165,7 +165,7 @@ export default class Test extends SfCommand<RunCommandResult> {
165165 }
166166 }
167167
168- // eslint-disable-next-line class-methods-use-this,complexity
168+ // eslint-disable-next-line class-methods-use-this
169169 public async validateFlags (
170170 codeCoverage ?: boolean ,
171171 resultFormatFlag ?: string ,
@@ -187,16 +187,13 @@ export default class Test extends SfCommand<RunCommandResult> {
187187 return Promise . reject ( new Error ( messages . getMessage ( 'testLevelErr' ) ) ) ;
188188 }
189189
190- let test : TestLevel ;
191190 if ( testLevel ) {
192- test = testLevel ;
193- } else if ( classNames || suiteNames || tests ) {
194- test = TestLevel . RunSpecifiedTests ;
195- } else {
196- test = TestLevel . RunLocalTests ;
191+ return testLevel ;
197192 }
198-
199- return test ;
193+ if ( classNames || suiteNames || tests ) {
194+ return TestLevel . RunSpecifiedTests ;
195+ }
196+ return TestLevel . RunLocalTests ;
200197 }
201198
202199 private async runTest (
@@ -212,11 +209,11 @@ export default class Test extends SfCommand<RunCommandResult> {
212209 ...( await testService . buildSyncPayload ( testLevel , flags . tests , flags [ 'class-names' ] ) ) ,
213210 skipCodeCoverage : ! flags [ 'code-coverage' ] ,
214211 } ;
215- return ( await testService . runTestSynchronous (
212+ return testService . runTestSynchronous (
216213 payload ,
217214 flags [ 'code-coverage' ] ,
218215 this . cancellationTokenSource . token
219- ) ) as TestResult ;
216+ ) as Promise < TestResult > ;
220217 }
221218
222219 private async runTestAsynchronous (
@@ -239,12 +236,12 @@ export default class Test extends SfCommand<RunCommandResult> {
239236 } ;
240237
241238 // cast as TestRunIdResult because we're building an async payload which will return an async result
242- return ( await testService . runTestAsynchronous (
239+ return testService . runTestAsynchronous (
243240 payload ,
244241 flags [ 'code-coverage' ] ,
245242 flags . wait ? false : ! ( flags . synchronous && ! this . jsonEnabled ( ) ) ,
246243 undefined ,
247244 this . cancellationTokenSource . token
248- ) ) as TestRunIdResult ;
245+ ) as Promise < TestRunIdResult > ;
249246 }
250247}
0 commit comments