提交 cbf08261 编写于 作者: 杜庆泉's avatar 杜庆泉

增加混編自动测试示例

上级 cd120925
import { describe, test, expect, Result } from './tests.uts'
export function testNativeCode(): Result {
return describe("mix-native-code-work", () => {
test('getStrFromNativeCode', () => {
// #ifdef APP-ANDROID
expect(NativeCode.getNativeStr()).toEqual("android-code");
// #endif
})
})
}
package uts.sdk.modules.utsTests
import android.os.Build
import io.dcloud.uts.UTSAndroid
object NativeCode {
fun getNativeStr():String{
return "android-code"
}
}
\ No newline at end of file
......@@ -18,6 +18,7 @@ import { testGlobal } from './Global.uts'
import { testType } from './Type.uts'
export { Result } from './tests.uts'
import { testArrayBuffer } from './ArrayBuffer.uts'
import { testNativeCode } from './NativeCode.uts'
// Promise、Proxy、Reflect、Weakmap、WeakSet 不支持
......@@ -41,6 +42,7 @@ export function runTests() : UTSJSONObject {
const consoleRes = testConsole();
const UTSJSONObjectRes = testUTSJSONObject();
const ArrayBufferRes = testArrayBuffer();
const NativeCodeRes = testNativeCode();
return {
Array: ArrayRes,
Date: DateRes,
......@@ -60,6 +62,7 @@ export function runTests() : UTSJSONObject {
Type: TypeRes,
console:consoleRes,
UTSJSONObject:UTSJSONObjectRes,
ArrayBuffer:ArrayBufferRes
ArrayBuffer:ArrayBufferRes,
NativeCode:NativeCodeRes
}
}
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册