harmony 鸿蒙@ohos.application.testRunner (TestRunner)
@ohos.application.testRunner (TestRunner)
The TestRunner module provides a test framework. You can use the APIs of this module to prepare the unit test environment and run test cases.
To implement your own unit test framework, extend this class and override its APIs.
NOTE
The initial APIs of this module are supported since API version 8. Newly added APIs will be marked with a superscript to indicate their earliest API version.
The APIs of this module can be used only in arkxtest.
Modules to Import
import { TestRunner } from '@kit.TestKit';
TestRunner.onPrepare
onPrepare(): void
Prepares the unit test environment to run test cases.
System capability: SystemCapability.Ability.AbilityRuntime.Core
Atomic service API: This API can be used in atomic services since API version 11.
Example
import { TestRunner } from '@kit.TestKit';
export default class UserTestRunner implements TestRunner {
onPrepare() {
console.log('Trigger onPrepare');
}
onRun() {
}
};
TestRunner.onRun
onRun(): void
Runs test cases.
System capability: SystemCapability.Ability.AbilityRuntime.Core
Atomic service API: This API can be used in atomic services since API version 11.
Example
import { TestRunner } from '@kit.TestKit';
export default class UserTestRunner implements TestRunner {
onPrepare() {
}
onRun() {
console.log('Trigger onRun');
}
};
你可能感兴趣的鸿蒙文章
harmony 鸿蒙@ohos.app.ability.abilityDelegatorRegistry (AbilityDelegatorRegistry)
harmony 鸿蒙@ohos.application.abilityDelegatorRegistry (AbilityDelegatorRegistry)
- 所属分类: 后端技术
- 本文标签:
热门推荐
-
2、 - 优质文章
-
3、 gate.io
-
8、 golang
-
9、 openharmony
-
10、 Vue中input框自动聚焦