# NodeApiTestCase **Repository Path**: jiangtao92/node-api-test-case ## Basic Information - **Project Name**: NodeApiTestCase - **Description**: node js node-api 测试用例OHOS移植 - **Primary Language**: JavaScript - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 3 - **Created**: 2022-08-12 - **Last Updated**: 2023-07-21 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # NodeApiTestCase #### 介绍 nodejs node-api测试用例OHOS移植,验证OH上的napi实现是否符合规范。 原始用例:https://github.com/nodejs/node/tree/main/test/js-native-api * [napi规范](https://nodejs.org/api/n-api.html) * [OpenHarmony测试框架](https://developer.harmonyos.com/cn/docs/documentation/doc-guides/ohos-openharmony-test-framework-0000001263160453) * [单元测试框架](https://gitee.com/openharmony/arkXtest/blob/master/README_zh.md#%E5%8D%95%E5%85%83%E6%B5%8B%E8%AF%95%E6%A1%86%E6%9E%B6%E5%8A%9F%E8%83%BD%E7%89%B9%E6%80%A7) #### 测试结果 |测试结果| 单元测试 | 备注 | |-----|-----|-----| |✔️|2_function_arguments|| |❌|3_callbacks|用例运行崩溃 [测试结果](entry/src/main/cpp/3_callbacks/test_result/3_callbacks.md)| |❌|4_object_factory|用例运行崩溃 [测试结果](./entry/src/main/cpp/4_object_factory/test_result/4_object_factory.md)| |✔️|5_function_factory|| |✔️|6_object_wrap|| |✔️|7_factory_wrap|| |✔️|8_passing_wrapped|| |✔️|test_array|| |❌|test_bigint|测试用例崩溃 [测试结果](./entry/src/main/cpp/test_bigint/test_result/test_bigint.md)| |❌|test_constructor|用例执行失败 [测试结果](./entry/src/main/cpp/test_constructor/test_result/test_constructor.md)| |❌|test_conversions|符号缺失,链接错误 [测试结果](./test_result/test_conversions.md)| |❌|test_dataview|用例执行失败 [测试结果](./entry/src/main/cpp/test_dataview/test_result/test_dataview.md)| |✔️|test_date|| |❌|test_error|符号缺失,链接错误 [测试结果](./test_result/test_error.md)| |📅|test_exception|doing,用例迁移中| |❌|test_function|import so 导致js crash [测试结果](./test_result/test_function.md)| |❌|test_general|符号缺失,链接错误[测试结果](./test_result/test_general.md)| |❌|test_handle_scope|例执行失败 [测试结果](./entry/src/main/cpp/test_handle_scope/test_result/test_handle_scope.md)| |❌|test_instance_data|符号缺失,链接错误 [测试结果](./test_result/test_instance_data.md)| |❌|test_new_target|import so 导致js crash [测试结果](./test_result/test_new_target.md)| |❌|test_number|用例执行失败 [测试结果](./entry/src/main/cpp/test_number/test_result/test_number.md)| |❌|test_object|符号缺失,链接错误 [测试结果](./test_result/test_object.md)| |📅|test_promise|doing,用例迁移中| |❌|test_properties|符号缺失,链接错误 [测试结果](./test_result/test_properties.md)| |❌|test_reference|符号缺失,链接错误 [测试结果](./test_result/test_reference.md)| |❌|test_reference_double_free|用例运行崩溃 [测试结果](./test_result/test_reference_double_free.md)| |❌|test_string|符号缺失,链接错误 [测试结果](./test_result/test_string.md)| |❌|test_symbol|用例执行失败 [测试结果](./entry/src/main/cpp/test_symbol/test_result/test_symbol.md)| |❌|test_typedarray|符号缺失,链接错误 [测试结果](./entry/src/main/cpp/test_typedarray/test_result/test_typedarray.md)| ### 结果统计 总计用例 29 个,通过用例 8个,待迁移 2个,失败用例 19个, 其中 * 符号缺失,链接错误: 9个 * napi_create_string_utf16 * napi_get_value_string_utf16 * node_api_throw_syntax_error * node_api_create_syntax_error * napi_set_instance_data * napi_get_instance_data * napi_add_finalizer * napi_get_all_property_names * napi_type_tag_object * napi_check_object_type_tag * napi_object_freeze * napi_object_seal * node_api_symbol_for * napi_detach_arraybuffer * napi_is_detached_arraybuffer * 用例执行失败:5个 * 用例运行崩溃: 3个 * import so 导致js crash: 2个 #### doing * 【测试框架迁移】deepStrictEqual OHOS实现 * 【测试框架迁移】mustCall OHOS实现