NativeCode.uts 620 字节
Newer Older
杜庆泉's avatar
杜庆泉 已提交
1
import { describe, test, expect, Result } from './tests.uts'
雪洛's avatar
雪洛 已提交
2 3 4
// #ifdef APP-HARMONY
import { NativeCode } from './app-harmony/arktsCode.ets'
// #endif
杜庆泉's avatar
杜庆泉 已提交
5 6

export function testNativeCode(): Result {
雪洛's avatar
雪洛 已提交
7 8 9 10 11 12 13 14 15 16 17
  return describe("mix-native-code-work", () => {
    test('getStrFromNativeCode', () => {
      // #ifdef APP-ANDROID
      expect(NativeCode.getNativeStr()).toEqual("android-code");
      // #endif
      // #ifdef APP-IOS
      expect(NativeCode.getNativeStr()).toEqual("iOS-code");
      // #endif
      // #ifdef APP-HARMONY
      expect(NativeCode.getNativeStr()).toEqual("harmonyos-code");
      // #endif
杜庆泉's avatar
杜庆泉 已提交
18
    })
雪洛's avatar
雪洛 已提交
19
  })
杜庆泉's avatar
杜庆泉 已提交
20
}