Files
meida/app/entry/src/ohosTest/ets/test/Ability.test.ets
T
xsl 9503c6e259 feat(app): FE 骨架协调提交——core 网络层/路由注册/页面桩
- DevEco 6.1 模板工程(API 6.1.1(24),bundle com.xiangsilian.app)+ INTERNET 权限
- core/:ApiClient(统一信封解包+401 自动刷新重试)/AuthStore(双令牌持久化+
  dev-token 通道+baseUrl 可配)/ContextHolder/ApiTypes —— 全部通过 ArkTS 严格编译
- 七页面注册 main_pages(桩态);Index 按登录态分流;页面间约定 router 路径跳转
  零 import(并行冲突隔离)
- app/README:CLI 构建门禁命令与代码约定
2026-08-15 00:33:55 +08:00

35 lines
1.7 KiB
Plaintext

import { hilog } from '@kit.PerformanceAnalysisKit';
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium';
export default function abilityTest() {
describe('ActsAbilityTest', () => {
// Defines a test suite. Two parameters are supported: test suite name and test suite function.
beforeAll(() => {
// Presets an action, which is performed only once before all test cases of the test suite start.
// This API supports only one parameter: preset action function.
})
beforeEach(() => {
// Presets an action, which is performed before each unit test case starts.
// The number of execution times is the same as the number of test cases defined by **it**.
// This API supports only one parameter: preset action function.
})
afterEach(() => {
// Presets a clear action, which is performed after each unit test case ends.
// The number of execution times is the same as the number of test cases defined by **it**.
// This API supports only one parameter: clear action function.
})
afterAll(() => {
// Presets a clear action, which is performed after all test cases of the test suite end.
// This API supports only one parameter: clear action function.
})
it('assertContain', 0, () => {
// Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function.
hilog.info(0x0000, 'testTag', '%{public}s', 'it begin');
let a = 'abc';
let b = 'b';
// Defines a variety of assertion methods, which are used to declare expected boolean conditions.
expect(a).assertContain(b);
expect(a).assertEqual(a);
})
})
}