1.全局配置能力的部分测试用例查看

Signed-off-by: zhoulisheng1 <zhoulisheng1@huawei.com>
This commit is contained in:
zhoulisheng1 2023-05-05 18:02:15 +08:00
parent 77bd473b9f
commit a5da43a82b
2 changed files with 6 additions and 7 deletions

View File

@ -17,6 +17,7 @@ import lruCacheTest from './lrucache'
import LogUtilTest from './logutil' import LogUtilTest from './logutil'
import Transform from './transfrom' import Transform from './transfrom'
import RequestOptionTest from './requestoption' import RequestOptionTest from './requestoption'
import ImageKnifeTest from './imageknife'
export default function testsuite() { export default function testsuite() {
abilityTest() abilityTest()
@ -24,4 +25,5 @@ export default function testsuite() {
LogUtilTest() LogUtilTest()
Transform() Transform()
RequestOptionTest() RequestOptionTest()
ImageKnifeTest();
} }

View File

@ -16,8 +16,8 @@ import hilog from '@ohos.hilog';
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'
import {ImageKnife,ImageKnifeDrawFactory} from '@ohos/imageknife' import {ImageKnife,ImageKnifeDrawFactory} from '@ohos/imageknife'
export default function LogUtilTest() { export default function ImageKnifeTest() {
describe('LogUtilTest', function () { describe('ImageKnifeTest', function () {
// Defines a test suite. Two parameters are supported: test suite name and test suite function. // Defines a test suite. Two parameters are supported: test suite name and test suite function.
beforeAll(function () { beforeAll(function () {
// Presets an action, which is performed only once before all test cases of the test suite start. // Presets an action, which is performed only once before all test cases of the test suite start.
@ -42,7 +42,7 @@ export default function LogUtilTest() {
it('TestGlobalImageKnife',0, function () { it('TestGlobalImageKnife',0, function () {
expect(globalThis.ImageKnife).assertEqual(undefined) expect(globalThis.ImageKnife).assertEqual(undefined)
globalThis.ImageKnife = ImageKnife.with(getContext()) globalThis.ImageKnife = ImageKnife.with(getContext())
expect((globalThis.ImageKnife == undefined)).assertFalse() expect(globalThis.ImageKnife).not().assertUndefined()
}) })
@ -50,12 +50,9 @@ export default function LogUtilTest() {
globalThis.ImageKnife = ImageKnife.with(getContext()) globalThis.ImageKnife = ImageKnife.with(getContext())
globalThis.ImageKnife.setDefaultLifeCycle(ImageKnifeDrawFactory.createProgressLifeCycle("#10a5ff", 0.5)) globalThis.ImageKnife.setDefaultLifeCycle(ImageKnifeDrawFactory.createProgressLifeCycle("#10a5ff", 0.5))
let globalLifeCycle = globalThis.ImageKnife.getDefaultLifeCycle(); let globalLifeCycle = globalThis.ImageKnife.getDefaultLifeCycle();
expect(globalLifeCycle == undefined).assertFalse(); expect(globalLifeCycle).not().assertUndefined()
}) })
it('TestGlobalCacheKey',2, function () {
})