Skip to content

Commit b5f94ae

Browse files
Documentation updates (#10)
Co-authored-by: Chengzhong Wu <legendecas@gmail.com>
1 parent 6fbd941 commit b5f94ae

5 files changed

Lines changed: 33 additions & 10 deletions

File tree

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<!--
22
Before submitting a pull request, please read
3-
https://github.com/nodejs/js-native-api-test/blob/main/CONTRIBUTING.md.
3+
https://github.com/nodejs/node-api-cts/blob/main/CONTRIBUTING.md.
44
55
Developer's Certificate of Origin 1.1
66

.github/copilot-instructions.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Copilot Instructions for node-api-cts
2+
3+
## Project Overview
4+
5+
Node-API Conformance Test Suite: A pure ECMAScript test suite for Node-API implementors across different JS engines and runtimes (Node.js, Deno, Bun, React Native, WebAssembly, etc.).
6+
7+
## General Principles
8+
- **Keep it minimal**: Avoid unnecessary dependencies, configuration, or complexity
9+
- **Pure ECMAScript tests**: To lower the barrier for implementors to run the tests, all tests are written as single files of pure ECMAScript, with no import / export statements and no use of Node.js runtime APIs outside of the language standard (such as `process`, `require`, `node:*` modules).
10+
- **TypeScript tooling**: The tooling around the tests are written in TypeScript and expects to be ran in a Node.js compatible runtime with type-stripping enabled.
11+
- **Implementor Flexibility**: Native code building and loading is delegated to implementors, with the test-suite providing defaults that work for Node.js.
12+
- **Extra convenience**: Extra (generated) code is provided to make it easier for implementors to load and run tests, such as extra package exports exposing test functions that implementors can integrate with their preferred test frameworks.
13+
- **Process Isolation**: The built-in runner for Node.js, run each test in isolation to prevent crashes from aborting entire test suite.
14+
15+
## Development Focus
16+
- Port existing tests from `nodejs/node/test/js-native-api` into `tests/engine/` and `nodejs/node/test/node-api` into `tests/runtime/`, removing dependencies on Node.js runtime APIs while preserving test coverage
17+
- Structure tests for easy integration by external implementors
18+
- Consider following patterns from [web-platform-tests](https://web-platform-tests.org/) and [WebGPU CTS](https://github.com/gpuweb/cts) projects where applicable.

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# **js-native-api-test** Contribution Philosophy
1+
# **node-api-cts** Contribution Philosophy
22

3-
The **node-addon-api** team which maintains **js-native-api-test**
3+
The **node-addon-api** team which maintains **node-api-cts**
44
loves contributions. There are many ways in which you can
55
contribute:
66
- Source code fixes

LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
The MIT License (MIT)
22
=====================
33

4-
Copyright js-native-api-test and Node.js contributors
4+
Copyright node-api-cts and Node.js contributors
55
-----------------------------------------------------
66

77
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

README.md

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
1-
# js-native-api-test
1+
# Node-API Conformance Test Suite (`node-api-cts`)
22

3-
Test suite for JavaScript Engine specific portion of Node-api.
3+
A test suite for Node-API implementors across different JS engines and runtimes.
4+
Written in ECMAScript & C/C++ with an implementor customizable harness.
45

5-
This repository holds a copy of the js-native-api subset of the Node-api test suite so that
6-
it can be used to validate native api implementations outside of Node.js.
6+
> [!IMPORTANT]
7+
> This repository is currently a work-in-progress and shouldn't yet be relied on by anyone.
78
8-
Currently we are still working on the process to extract the test suite and publish it to this
9-
repo on a regular basis.
9+
## Overview
10+
11+
The tests are divided into two buckets, based on the two header files declaring the Node-API functions:
12+
13+
- `tests/js-native-api/*` testing the engine-specific part of Node-API defined in the [`js_native_api.h`](https://github.com/nodejs/node-api-headers/blob/main/include/js_native_api.h) header.
14+
- `tests/node-api/*` testing the runtime-specific part of Node-API defined in the [`node_api.h`](https://github.com/nodejs/node-api-headers/blob/main/include/node_api.h) header.

0 commit comments

Comments
 (0)