port test_string to CTS (#44)
- port test_string to CTS
Ports test_string from the Node.js test suite to the CTS.
- Most of the files are identical except for the js files and CMakeLists.txt
- js files use global assert and loadAddon instead of requiring modules
- CMakeLists.txt sets NAPI_VERSION >= 10, as API like node_api_create_external_string_latin1 are available only from NAPI_VERSION >= 10. Ref docs
Signed-off-by: Balakrishna Avulapati ba@bavulapati.com
- skip the test if napi version < 10
Signed-off-by: Balakrishna Avulapati ba@bavulapati.com
- split tests to separate v10 sub tests
Signed-off-by: Balakrishna Avulapati ba@bavulapati.com
- fix lint error
Signed-off-by: Balakrishna Avulapati ba@bavulapati.com
Signed-off-by: Balakrishna Avulapati ba@bavulapati.com Co-authored-by: Chengzhong Wu cwu631@bloomberg.net
版权所有:中国计算机学会技术支持:开源发展技术委员会
京ICP备13000930号-9
京公网安备 11010802032778号
Node-API Conformance Test Suite (
node-api-cts)A test suite for Node-API implementors across different JS engines and runtimes. Written in ECMAScript & C/C++ with an implementor customizable harness.
Overview
Tests
The tests are divided into three buckets:
tests/harness/*exercising the implementor’s test harness.and two parts based on the two header files declaring the Node-API functions:
tests/js-native-api/*testing the engine-specific part of Node-API defined in thejs_native_api.hheader.tests/node-api/*testing the runtime-specific part of Node-API defined in thenode_api.hheader.Implementors
This repository offers an opportunity for implementors of Node-API to maintain (parts of) their implementor-specific harness inside this repository, in a sub-directory of the
implementorsdirectory. We do this in hope of increased velocity from faster iteration and potentials for reuse of code across the harnesses.We maintain a list of other runtimes implementing Node-API in doc/node-api-engine-bindings.md of the
nodejs/abi-stable-noderepository.