Port the make_callback test addon from #219 and enable node-api/test_async in node-tests
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Facilidade para iniciantes
- 55/100
- Tipo de issue
- Funcionalidade
- Clareza
- Razoavelmente clara
- Status de atividade
- Pouca atividade
- Stack de tecnologia
- c, cmake, javascript, node.js, typescript
- Domínio
- build-system, testing-qa
Direção de pesquisa
Comece por packages/node-addon-examples/src/index.ts, pelo template CMake de tests/async, por scripts/copy-tests.mts e por packages/node-tests/common.ts; compare os arquivos make_callback de #219 com o addon threadsafe-function de #398. Execute as verificações do repositório para node-addon-examples e node-tests. Está concluído quando o addon for compilado e registrado, node-api/test_async estiver habilitado e ambos os caminhos de teste passarem.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
Two test-coverage follow-ups deferred from #398. Both validate functionality that Hermes' first-party Node-API implementation provides on its own (independent of the hermes_napi_host integration), so they were split out as test-infrastructure work.
1. Port the make_callback test addon from #219
napi_async_init / napi_async_destroy / napi_make_callback are provided natively by the vendored Hermes since the static_h adoption (the injector binds the full symbol surface), which obsoletes #219's host-side C++ implementation — but its test addon (tests/make_callback/: addon.c adapted from Node's own test plus a promise-less driver asserting receiver/argument/return-value plumbing) ports directly to the packages/node-addon-examples/tests/<name>/ pattern established there and in #398:
- Copy
addon.c,addon.js,binding.gypfrom #219 (credit @paradowstack), add the checked-inCMakeLists.txtper thetests/asynctemplate and apackage.jsonwith a unique name (e.g.make-callback-test). - Register under
suites.testsinpackages/node-addon-examples/src/index.ts.
Expected to pass as-is against next — a failure would be a real conformance finding against Hermes' implementation.
2. Enable node-api/test_async in packages/node-tests
The entry exists but is commented out in scripts/copy-tests.mts's ALLOW_LIST. Two independent blockers:
commonshims: the bundling pipeline aliases../../commontopackages/node-tests/common.ts, which currently only exportsbuildType. Upstreamtest.jsusescommon.mustCall. A faithfulmustCall/mustCallAtLeast/mustNotCallneeds a home for its verification step: upstream checks call counts at process exit, which has no analogue in the long-lived mocha-remote app — the shim needs a per-test verification hook wired into the generated suite (e.g. anafterEach-style flush exposed fromcommon.ts).<uv.h>in the C side: upstreamtest_async.cincludes<uv.h>directly, so enabling it also needs a small uv shim along the lines of the pthread-based one written fortests/threadsafe-function/addon.cin #398 (or an upstream contribution making the test buildable without libuv).
Note on value: the behavioral coverage largely overlaps the hand-written tests/async addon (create/queue/cancel/delete, cancel-while-queued via pool saturation — upstream's MAX_CANCEL_THREADS 6 trick is the same one tests/async already uses — plus the #398 additions for thread identity and cancel-while-running). The win from enabling the upstream suite is conformance tracking against Node itself rather than new coverage, which is also why it wasn't a blocker for #398.
- Linguagem predominante
- TypeScript
- Estrelas
- 188
- Forks
- 10
- Merge médio
- 2d 17h
- PRs com merge (30d)
- 3
Guia de contribuição
Nenhum guia de contribuição indexado para este repositório
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de callstackincubator/react-native-node-api
-
Android 🤖
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 66/100
-
Sanity check of Hermes source directory via environment variable, when building Android projects AbertaAndroid 🤖 good first issue
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
callstackincubator/react-native-node-api#163 · 1 comentário ·
-
enhancement good first issue gyp-to-cmake
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
callstackincubator/react-native-node-api#161 · 3 comentários · 1 reação ·
-
enhancement Host 🏡
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 25/100
-
Automatable good first issue
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 15/100
callstackincubator/react-native-node-api#424 · 1 comentário ·
Todas as issues de callstackincubator/react-native-node-api
Issues semelhantes
-
blocklist removal
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 65/100
MetaMask/eth-phishing-detect#296544 ·
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 70/100
pastelsky/bundlephobia#1122 ·
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 70/100
-
category/development priority/P2 scope/file-operations scope/testing type/enhancement
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
-
Enatega Customer and Rider app: Add-ons price is not visible to customer after order is placed. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100